Enable some 'eden stop' tests with systemd

Summary:
The following tests in stop_test.py pass with systemd enabled:

* test_killing_hung_daemon_during_stop_makes_stop_finish
* test_stop_not_running
* test_stop_stops_running_daemon
* test_stopping_daemon_stopped_by_sigstop_kills_daemon
* test_stopping_killed_daemon_reports_not_running

Enable these tests to prevent regressions.

Reviewed By: chadaustin

Differential Revision: D13229634

fbshipit-source-id: 1c632260afdc7286bd8b1465258b129f20f02f18
This commit is contained in:
Matt Glazar 2018-12-06 17:42:33 -08:00 committed by Facebook Github Bot
parent c20d275a6b
commit e53e3c4cad

View File

@ -31,8 +31,7 @@ SHUTDOWN_EXIT_CODE_NOT_RUNNING_ERROR = 2
SHUTDOWN_EXIT_CODE_TERMINATED_VIA_SIGKILL = 3
# TODO(T33122320): Support 'eden stop' with systemd.
@service_test(skip_systemd=True)
@service_test
class StopTest(ServiceTestCaseBase, PexpectAssertionMixin, TemporaryDirectoryMixin):
def setUp(self) -> None:
super().setUp()
@ -48,6 +47,9 @@ class StopTest(ServiceTestCaseBase, PexpectAssertionMixin, TemporaryDirectoryMix
)
def test_eden_stop_shuts_down_edenfs_cleanly(self) -> None:
self.skip_if_systemd(
"TODO(T33122320): Forward custom daemon arguments to edenfs"
)
clean_shutdown_file = pathlib.Path(self.tmp_dir) / "clean_shutdown"
assert not clean_shutdown_file.exists()
@ -68,6 +70,9 @@ class StopTest(ServiceTestCaseBase, PexpectAssertionMixin, TemporaryDirectoryMix
)
def test_stop_sigkill(self) -> None:
self.skip_if_systemd(
"TODO(T33122320): Forward custom daemon arguments to edenfs"
)
with self.spawn_fake_edenfs(pathlib.Path(self.tmp_dir), ["--ignoreStop"]):
# Ask the CLI to stop edenfs, with a 1 second timeout.
# It should have to kill the process with SIGKILL
@ -146,6 +151,9 @@ class StopTest(ServiceTestCaseBase, PexpectAssertionMixin, TemporaryDirectoryMix
os.kill(daemon_pid, signal.SIGCONT)
def test_hanging_thrift_call_kills_daemon_with_sigkill(self) -> None:
self.skip_if_systemd(
"TODO(T33122320): Forward custom daemon arguments to edenfs"
)
with self.spawn_fake_edenfs(
pathlib.Path(self.tmp_dir), ["--sleepBeforeStop=5"]
):
@ -155,6 +163,9 @@ class StopTest(ServiceTestCaseBase, PexpectAssertionMixin, TemporaryDirectoryMix
)
def test_stop_succeeds_if_thrift_call_abruptly_kills_daemon(self) -> None:
self.skip_if_systemd(
"TODO(T33122320): Forward custom daemon arguments to edenfs"
)
with self.spawn_fake_edenfs(
pathlib.Path(self.tmp_dir), ["--exitWithoutCleanupOnStop"]
):