Skip to content

Commit 8d697b3

Browse files
author
cod1k
committed
TESTS: exception handling while spawning fcgi-program which address already bound to another process
1 parent a7cb60d commit 8d697b3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

supervisor/tests/test_process.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from supervisor.tests.base import DummyProcessGroup
2121
from supervisor.tests.base import DummyFCGIProcessGroup
2222

23-
from supervisor.process import Subprocess
23+
from supervisor.process import Subprocess, ProcessStates
2424
from supervisor.options import BadCommand
2525

2626
class SubprocessTests(unittest.TestCase):
@@ -1799,6 +1799,14 @@ def test_before_spawn_gets_socket_ref(self):
17991799
instance.before_spawn()
18001800
self.assertFalse(instance.fcgi_sock is None)
18011801

1802+
def test_before_spawn_failure_sets_fatal_state(self):
1803+
options = DummyOptions()
1804+
config = DummyPConfig(options, 'good', '/good/filename', uid=1)
1805+
instance = self._makeOne(config)
1806+
self.assertEqual(instance.state, ProcessStates.STOPPED)
1807+
instance.spawn()
1808+
self.assertEqual(instance.state, ProcessStates.FATAL)
1809+
18021810
def test_after_finish_removes_socket_ref(self):
18031811
options = DummyOptions()
18041812
config = DummyPConfig(options, 'good', '/good/filename', uid=1)

0 commit comments

Comments
 (0)