Commit c5f32a03 authored by Guido van Rossum's avatar Guido van Rossum

This test was broken by the change in what's in the pidfile. Fixed it

by assuming all pids in the pidfile must be killed.
parent 457cfb88
...@@ -65,14 +65,11 @@ class StartTests(unittest.TestCase): ...@@ -65,14 +65,11 @@ class StartTests(unittest.TestCase):
def getpids(self): def getpids(self):
if not os.path.exists(self.env.zeo_pid): if not os.path.exists(self.env.zeo_pid):
# If there's no pid file, assume the server isn't running # If there's no pid file, assume the server isn't running
return None, None return []
return map(int, open(self.env.zeo_pid).read().split()) return map(int, open(self.env.zeo_pid).read().split())
def stop_server(self): def stop_server(self):
ppid, pid = self.getpids() self.kill(pids=self.getpids())
if ppid is None:
return
self.kill(pids=[pid])
def kill(self, sig=signal.SIGTERM, pids=None): def kill(self, sig=signal.SIGTERM, pids=None):
if pids is None: if pids is None:
...@@ -141,7 +138,7 @@ class StartTests(unittest.TestCase): ...@@ -141,7 +138,7 @@ class StartTests(unittest.TestCase):
cs = ClientStorage(('', port), wait=wait) cs = ClientStorage(('', port), wait=wait)
cs.close() cs.close()
def testNoPort(self): def testErrNoPort(self):
outp = self.system("-s") outp = self.system("-s")
self.assert_(outp.find("No port specified") != -1) self.assert_(outp.find("No port specified") != -1)
...@@ -172,9 +169,7 @@ class StartTests(unittest.TestCase): ...@@ -172,9 +169,7 @@ class StartTests(unittest.TestCase):
break break
self.assert_(buf1) self.assert_(buf1)
os.rename(logfile1, logfile2) os.rename(logfile1, logfile2)
ppid, pid = self.getpids() self.kill(signal.SIGUSR2, pids=self.getpids())
## os.kill(ppid, signal.SIGHUP)
os.kill(pid, signal.SIGHUP)
self.connect(port=port) self.connect(port=port)
buf2 = open(logfile1).read() buf2 = open(logfile1).read()
self.assert_(buf2) self.assert_(buf2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment