Commit cb922396 authored by Tim Peters's avatar Tim Peters

Try to repair testRunIgnoresParentSignals.

Instead of poke-and-hope guessing at how long to wait
for the child process to start running, use send_action()
in a loop to ask about that more directly -- but don't
wait longer than a minute.

The test should run faster on most boxes now, but
take up to a minute on boxes that are bogged down for
whatever reason.

Note that this checkin is being made from a wrong place!
zdaemon isn't part of the Zope tree, it's stitched in
from the zdaemon repository.  So this checkin has no
effect on zdaemon.  It will need to be sideported later
if it turns out to fix the overnight test failures.
parent 2d291875
......@@ -217,15 +217,24 @@ class ZDaemonTests(unittest.TestCase):
sys.executable,
[sys.executable, os.path.join(self.here, 'parent.py')]
)
time.sleep(2) # race condition possible here
# Wait for it to start, but no longer than a minute.
deadline = time.time() + 60
is_started = False
while time.time() < deadline:
response = send_action('status\n', zdrun_socket)
if response is None:
time.sleep(0.05)
else:
is_started = True
break
self.assert_(is_started, "spawned process failed to start in a minute")
# Kill it, and wait a little to ensure it's dead.
os.kill(zdctlpid, signal.SIGINT)
try:
response = send_action('status\n', zdrun_socket) or ''
except socket.error, msg:
response = ''
params = response.split('\n')
self.assert_(len(params) > 1, repr(response))
# kill the process
time.sleep(0.25)
# Make sure the child is still responsive.
response = send_action('status\n', zdrun_socket)
self.assert_(response is not None and '\n' in response)
# Kill the process.
send_action('exit\n', zdrun_socket)
def testUmask(self):
......
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