def assert_shutdown_fails_with_in_progress_graceful_restart( self, client: EdenClient ) -> None: # call initiateShutdown. This should not throw. try: client.initiateShutdown("shutdown requested during graceful restart") except Exception: self.fail( "initiateShutdown should not throw when graceful restart is in progress" ) self.assertEqual(client.getDaemonInfo().status, fb303_status.STOPPING)
def assert_sigkill_fails_with_in_progress_graceful_restart( self, client: EdenClient ) -> None: # send SIGTERM to process. This should not throw. pid = self.eden.get_pid_via_thrift() try: os.kill(pid, signal.SIGTERM) except Exception: self.fail( "sending SIGTERM should not throw when graceful restart is in progress" ) self.assertEqual(client.getDaemonInfo().status, fb303_status.STOPPING)
def assert_restart_fails_with_in_progress_graceful_restart( self, client: EdenClient ) -> None: pid = self.eden.get_pid_via_thrift() p = self.run_restart() p.expect_exact( f"The current edenfs daemon (pid {pid}) is in the middle of stopping." f"\r\nUse `eden restart --force` if you want to forcibly restart the current daemon\r\n" ) p.wait() self.assertEqual(p.exitstatus, 4) self.assertEqual(client.getDaemonInfo().status, fb303_status.STOPPING)