lock test: make more robust against timing

Remove the stdout printing from the lock_test_help.py, so that there is no
problem with a failing test because one output ending up in stdout before the
other. So only output the current lock from lock_test.sh.

Change-Id: I7fe80a9de88ddee1d66ca5c692948fc9673e4230
This commit is contained in:
Neels Hofmeyr 2017-05-10 13:46:11 +02:00 committed by Neels Hofmeyr
parent 4f33dcc4df
commit 2321a19aa5
2 changed files with 0 additions and 8 deletions

View File

@ -1,8 +1,4 @@
acquired lock: 'long name'
launched first, locked by: long name
launched second, locked by: long name
leaving lock: 'long name'
acquired lock: 'shorter'
waited, locked by: shorter
leaving lock: 'shorter'
waited more, locked by:

View File

@ -14,12 +14,8 @@ lockfile_path = os.path.join(testdir, 'lock_test')
fl = FileLock(lockfile_path, name)
with fl:
print('acquired lock: %r' % fl.owner)
sys.stdout.flush()
while os.path.exists(stop_signalling_file):
time.sleep(.1)
print('leaving lock: %r' % fl.owner)
sys.stdout.flush()
touch_file(stop_signalling_file + '.done')
# vim: expandtab tabstop=4 shiftwidth=4