Commit ecad3244 authored by dieter's avatar dieter

try to fix race condition in test `runzeo_without_configfile`

parent 80715eae
...@@ -251,6 +251,7 @@ class ZEOServer(object): ...@@ -251,6 +251,7 @@ class ZEOServer(object):
def loop_forever(self): def loop_forever(self):
if self.options.testing_exit_immediately: if self.options.testing_exit_immediately:
print("testing exit immediately") print("testing exit immediately")
sys.stdout.flush() # ensure truthful output order
else: else:
self.server.loop() self.server.loop()
......
...@@ -1221,7 +1221,7 @@ def client_asyncore_thread_has_name(): ...@@ -1221,7 +1221,7 @@ def client_asyncore_thread_has_name():
""" """
def runzeo_without_configfile(): def runzeo_without_configfile():
""" r"""
>>> with open('runzeo', 'w') as r: >>> with open('runzeo', 'w') as r:
... _ = r.write(''' ... _ = r.write('''
... import sys ... import sys
...@@ -1231,10 +1231,13 @@ def runzeo_without_configfile(): ...@@ -1231,10 +1231,13 @@ def runzeo_without_configfile():
... ''' % sys.path) ... ''' % sys.path)
>>> import subprocess, re >>> import subprocess, re
>>> print(re.sub(br'\d\d+|[:]', b'', subprocess.Popen( >>> proc = subprocess.Popen(
... [sys.executable, 'runzeo', '-a:0', '-ft', '--test'], ... [sys.executable, 'runzeo', '-a:0', '-ft', '--test'],
... stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ... stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
... ).stdout.read()).decode('ascii')) ... )
>>> proc.wait()
0
>>> print(re.sub(br'\d\d+|[:]', b'', proc.stdout.read()).decode('ascii'))
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
------ ------
--T INFO ZEO.runzeo () opening storage '1' using FileStorage --T INFO ZEO.runzeo () opening storage '1' using FileStorage
...@@ -1242,9 +1245,10 @@ def runzeo_without_configfile(): ...@@ -1242,9 +1245,10 @@ def runzeo_without_configfile():
--T INFO ZEO.StorageServer StorageServer created RW with storages 1RWt --T INFO ZEO.StorageServer StorageServer created RW with storages 1RWt
------ ------
--T INFO ZEO.asyncio... listening on ... --T INFO ZEO.asyncio... listening on ...
testing exit immediately
------ ------
--T INFO ZEO.StorageServer closing storage '1' --T INFO ZEO.StorageServer closing storage '1'
testing exit immediately >>> proc.stdout.close()
""" """
def close_client_storage_w_invalidations(): def close_client_storage_w_invalidations():
......
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