Skip to content

Commit

Permalink
Increase lock timeout in test
Browse files Browse the repository at this point in the history
Avoid spurious failures if the lock gets removed before the code checks
for it.
  • Loading branch information
Flamefire committed Apr 16, 2024
1 parent 68fdedb commit 3a17370
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3560,8 +3560,8 @@ def __exit__(self, type, value, traceback):

all_args = extra_args + opts

# use context manager to remove lock after 3 seconds
with RemoveLockAfter(3, toy_lock_path):
# use context manager to remove lock after 5 seconds
with RemoveLockAfter(5, toy_lock_path):
self.mock_stderr(True)
self.mock_stdout(True)
self.test_toy_build(extra_args=all_args, verify=False, raise_error=True, testing=False)
Expand All @@ -3576,7 +3576,7 @@ def __exit__(self, type, value, traceback):

wait_matches = wait_regex.findall(stdout)
# we can't rely on an exact number of 'waiting' messages, so let's go with a range...
self.assertIn(len(wait_matches), range(1, 5))
self.assertIn(len(wait_matches), range(1, 7))

self.assertTrue(ok_regex.search(stdout), "Pattern '%s' found in: %s" % (ok_regex.pattern, stdout))

Expand Down

0 comments on commit 3a17370

Please sign in to comment.