test-concurrency: Lower lock timeout

If there's a locking issue in this test, then it's likely not going to
resolve after a few seconds of serializing access. Lower the default 30
second lock timeout to 5 seconds to prevent the test from hanging
unnecessarily.
This commit is contained in:
Dan Nicholson 2021-04-19 10:03:57 -06:00
parent 89f4ce2c1d
commit 055b263dee
1 changed files with 6 additions and 2 deletions

View File

@ -40,11 +40,15 @@ def mktree(dname, serial=0):
f.write('{} {} {}\n'.format(dname, serial, v)) f.write('{} {} {}\n'.format(dname, serial, v))
subprocess.check_call(['ostree', '--repo=repo', 'init', '--mode=bare']) subprocess.check_call(['ostree', '--repo=repo', 'init', '--mode=bare'])
# like the bit in libtest, but let's do it unconditionally since it's simpler,
# and we don't need xattr coverage for this
with open('repo/config', 'a') as f: with open('repo/config', 'a') as f:
# like the bit in libtest, but let's do it unconditionally since
# it's simpler, and we don't need xattr coverage for this
f.write('disable-xattrs=true\n') f.write('disable-xattrs=true\n')
# Make any locking errors fail quickly instead of blocking the test
# for 30 seconds.
f.write('lock-timeout-secs=5\n')
def commit(v): def commit(v):
tdir='tree{}'.format(v) tdir='tree{}'.format(v)
cmd = ['ostree', '--repo=repo', 'commit', '--fsync=0', '-b', tdir, '--tree=dir='+tdir] cmd = ['ostree', '--repo=repo', 'commit', '--fsync=0', '-b', tdir, '--tree=dir='+tdir]