diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2017-05-10 13:46:11 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-11 10:31:46 +0000
commit2321a19aa52fc55c07436b062390eef7c440750d (patch)
parent4f33dcc4dfdb64f02541190068fe2b069fa31e37 (diff)
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
2 files changed, 0 insertions, 8 deletions
diff --git a/selftest/lock_test.ok b/selftest/lock_test.ok
index 0e3db40..d7152ac 100644
--- a/selftest/lock_test.ok
+++ b/selftest/lock_test.ok
@@ -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:
diff --git a/selftest/lock_test_help.py b/selftest/lock_test_help.py
index 7b6dfa1..bdf7c64 100644
--- a/selftest/lock_test_help.py
+++ b/selftest/lock_test_help.py
@@ -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):
- print('leaving lock: %r' % fl.owner)
- sys.stdout.flush()
touch_file(stop_signalling_file + '.done')
# vim: expandtab tabstop=4 shiftwidth=4