diff --git a/supervisor/tests/test_process.py b/supervisor/tests/test_process.py index d9370e24c..9c55b568c 100644 --- a/supervisor/tests/test_process.py +++ b/supervisor/tests/test_process.py @@ -20,7 +20,7 @@ from supervisor.tests.base import DummyProcessGroup from supervisor.tests.base import DummyFCGIProcessGroup -from supervisor.process import Subprocess +from supervisor.process import Subprocess, ProcessStates from supervisor.options import BadCommand class SubprocessTests(unittest.TestCase): @@ -1799,6 +1799,14 @@ def test_before_spawn_gets_socket_ref(self): instance.before_spawn() self.assertFalse(instance.fcgi_sock is None) + def test_before_spawn_failure_sets_fatal_state(self): + options = DummyOptions() + config = DummyPConfig(options, 'good', '/good/filename', uid=1) + instance = self._makeOne(config) + self.assertEqual(instance.state, ProcessStates.STOPPED) + instance.spawn() + self.assertEqual(instance.state, ProcessStates.FATAL) + def test_after_finish_removes_socket_ref(self): options = DummyOptions() config = DummyPConfig(options, 'good', '/good/filename', uid=1)