2121class EndToEndTests (BaseTestCase ):
2222
2323 def test_issue_550 (self ):
24+ """When an environment variable is set in the [supervisord] section,
25+ it should be put into the environment of the subprocess."""
2426 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-550.conf' )
2527 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
2628 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -35,6 +37,8 @@ def test_issue_550(self):
3537 supervisorctl .expect (pexpect .EOF )
3638
3739 def test_issue_565 (self ):
40+ """When a log file has Unicode characters in it, 'supervisorctl
41+ tail -f name' should still work."""
3842 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-565.conf' )
3943 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
4044 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -50,6 +54,8 @@ def test_issue_565(self):
5054 supervisorctl .expect_exact (line , timeout = 30 )
5155
5256 def test_issue_638 (self ):
57+ """When a process outputs something on its stdout or stderr file
58+ descriptor that is not valid UTF-8, supervisord should not crash."""
5359 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-638.conf' )
5460 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
5561 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -67,6 +73,8 @@ def test_issue_638(self):
6773 'too many start retries too quickly' , timeout = 60 )
6874
6975 def test_issue_663 (self ):
76+ """When Supervisor is run on Python 3, the eventlistener protocol
77+ should work."""
7078 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-663.conf' )
7179 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
7280 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -76,11 +84,15 @@ def test_issue_663(self):
7684 supervisord .expect_exact ('BUSY -> ACKNOWLEDGED' , timeout = 30 )
7785
7886 def test_issue_664 (self ):
87+ """When a subprocess name has Unicode characters, 'supervisord'
88+ should not send incomplete XML-RPC responses and 'supervisorctl
89+ status' should work."""
7990 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-664.conf' )
8091 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
8192 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
8293 self .addCleanup (supervisord .kill , signal .SIGINT )
8394 supervisord .expect_exact ('test_öäü entered RUNNING state' , timeout = 60 )
95+
8496 args = ['-m' , 'supervisor.supervisorctl' , '-c' , filename , 'status' ]
8597 supervisorctl = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
8698 self .addCleanup (supervisorctl .kill , signal .SIGINT )
@@ -92,6 +104,8 @@ def test_issue_664(self):
92104 self .assertTrue (seen )
93105
94106 def test_issue_733 (self ):
107+ """When a subprocess enters the FATAL state, a one-line eventlistener
108+ can be used to signal supervisord to shut down."""
95109 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-733.conf' )
96110 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
97111 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -138,6 +152,8 @@ def test_issue_836(self):
138152 self .assertTrue (seen )
139153
140154 def test_issue_1054 (self ):
155+ """When run on Python 3, the 'supervisorctl avail' command
156+ should work."""
141157 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1054.conf' )
142158 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
143159 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -153,34 +169,51 @@ def test_issue_1054(self):
153169 self .assertTrue (seen )
154170
155171 def test_issue_1170a (self ):
172+ """When the [supervisord] section has a variable defined in
173+ environment=, that variable should be able to be used in an
174+ %(ENV_x) expansion in a [program] section."""
156175 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1170a.conf' )
157176 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
158177 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
159178 self .addCleanup (supervisord .kill , signal .SIGINT )
160179 supervisord .expect_exact ("set from [supervisord] section" )
161180
162181 def test_issue_1170b (self ):
182+ """When the [supervisord] section has a variable defined in
183+ environment=, and a variable by the same name is defined in
184+ enviroment= of a [program] section, the one in the [program]
185+ section should be used."""
163186 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1170b.conf' )
164187 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
165188 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
166189 self .addCleanup (supervisord .kill , signal .SIGINT )
167190 supervisord .expect_exact ("set from [program] section" )
168191
169192 def test_issue_1170c (self ):
193+ """When the [supervisord] section has a variable defined in
194+ environment=, and a variable by the same name is defined in
195+ enviroment= of an [eventlistener] section, the one in the
196+ [eventlistener] section should be used."""
170197 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1170c.conf' )
171198 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
172199 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
173200 self .addCleanup (supervisord .kill , signal .SIGINT )
174201 supervisord .expect_exact ("set from [eventlistener] section" )
175202
176203 def test_issue_1224 (self ):
204+ """When the main log file does not need rotation (logfile_maxbyte=0)
205+ then the non-rotating logger will be used to avoid an
206+ IllegalSeekError in the case that the user has configured a
207+ non-seekable file like /dev/stdout."""
177208 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1224.conf' )
178209 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
179210 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
180211 self .addCleanup (supervisord .kill , signal .SIGINT )
181212 supervisord .expect_exact ('cat entered RUNNING state' , timeout = 60 )
182213
183214 def test_issue_1231a (self ):
215+ """When 'supervisorctl tail -f name' is run and the log contains
216+ unicode, it should not fail."""
184217 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1231a.conf' )
185218 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
186219 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -195,8 +228,9 @@ def test_issue_1231a(self):
195228 line = '%d - hash=57d94b…381088' % i
196229 supervisorctl .expect_exact (line , timeout = 30 )
197230
198-
199231 def test_issue_1231b (self ):
232+ """When 'supervisorctl tail -f name' is run and the log contains
233+ unicode, it should not fail."""
200234 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1231b.conf' )
201235 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
202236 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -229,6 +263,8 @@ def test_issue_1231b(self):
229263 break
230264
231265 def test_issue_1231c (self ):
266+ """When 'supervisorctl tail -f name' is run and the log contains
267+ unicode, it should not fail."""
232268 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1231c.conf' )
233269 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
234270 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -251,6 +287,8 @@ def test_issue_1231c(self):
251287 supervisorctl .expect ('Unicode output may fail.' , timeout = 30 )
252288
253289 def test_issue_1251 (self ):
290+ """When -? is given to supervisord or supervisorctl, help should be
291+ displayed like -h does."""
254292 args = ['-m' , 'supervisor.supervisord' , '-?' ]
255293 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
256294 self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -266,6 +304,9 @@ def test_issue_1251(self):
266304 supervisorctl .expect (pexpect .EOF )
267305
268306 def test_issue_1298 (self ):
307+ """When the output of 'supervisorctl tail -f worker' is piped such as
308+ 'supervisor tail -f worker | grep something', 'supervisorctl' should
309+ not crash."""
269310 filename = pkg_resources .resource_filename (__name__ , 'fixtures/issue-1298.conf' )
270311 args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
271312 supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
@@ -280,13 +321,17 @@ def test_issue_1298(self):
280321 bash .expect ('spewage 2' , timeout = 30 )
281322
282323 def test_issue_1481_pidproxy_cmd_with_no_args (self ):
324+ """When pidproxy is given a command to run that has no arguments, it
325+ runs that command."""
283326 args = ['-m' , 'supervisor.pidproxy' , 'nonexistent-pidfile' , "/bin/echo" ]
284327 pidproxy = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
285328 self .addCleanup (pidproxy .kill , signal .SIGINT )
286329 pidproxy .expect (pexpect .EOF )
287330 self .assertEqual (pidproxy .before .strip (), "" )
288331
289332 def test_issue_1481_pidproxy_cmd_with_args (self ):
333+ """When pidproxy is given a command to run that has arguments, it
334+ runs that command."""
290335 args = ['-m' , 'supervisor.pidproxy' , 'nonexistent-pidfile' , "/bin/echo" , "1" , "2" ]
291336 pidproxy = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
292337 self .addCleanup (pidproxy .kill , signal .SIGINT )
0 commit comments