Skip to content

Commit 229c478

Browse files
committed
Add test for Supervisor#1184
1 parent ffc6a03 commit 229c478

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[supervisord]
2+
loglevel = debug
3+
logfile=/tmp/issue-1184.log
4+
pidfile=/tmp/issue-1184.pid
5+
nodaemon = true
6+
7+
[unix_http_server]
8+
file = /tmp/issue-1184.sock
9+
10+
[supervisorctl]
11+
serverurl = unix:///tmp/issue-1184.sock
12+
13+
[rpcinterface:supervisor]
14+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
15+
16+
[program:cat]
17+
command = /bin/cat
18+
startsecs = 0
19+

supervisor/tests/test_end_to_end.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ def test_issue_1054(self):
129129
seen = False
130130
self.assertTrue(seen)
131131

132+
def test_issue_1184(self):
133+
filename = pkg_resources.resource_filename(__name__, 'fixtures/issue-1184.conf')
134+
args = ['-m', 'supervisor.supervisord', '-c', filename]
135+
supervisord = pexpect.spawn(sys.executable, args, encoding='utf-8')
136+
self.addCleanup(supervisord.kill, signal.SIGINT)
137+
supervisord.expect_exact('cat entered RUNNING state', timeout=60)
138+
t = SupervisorTransport(None, None, serverurl="unix:///tmp/issue-1184.sock")
139+
with xmlrpclib.ServerProxy('http://localhost', transport=t) as s:
140+
s.supervisor.shutdown() # should be no ResourceWarning for unclosed fd
132141

133142
def test_suite():
134143
return unittest.findTestCases(sys.modules[__name__])

0 commit comments

Comments
 (0)