Skip to content

Commit

Permalink
Merge pull request #4600 from Flamefire/fix-signal-test
Browse files Browse the repository at this point in the history
fix `test_toy_lock_cleanup_signals`
  • Loading branch information
boegel authored Aug 13, 2024
2 parents c1ef8d7 + 5847551 commit fd6e8b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3753,7 +3753,9 @@ def __exit__(self, type, value, traceback):
toy_ec_txt = read_file(os.path.join(test_ecs_dir, 't', 'toy', 'toy-0.0.eb'))

test_ec = os.path.join(self.test_prefix, 'test.eb')
write_file(test_ec, toy_ec_txt + '\npostinstallcmds = ["sleep 5"]')
write_file(test_ec, toy_ec_txt + '\npostinstallcmds = ["sleep 10"]')

extra_args = ['--locks-dir=%s' % locks_dir, '--wait-on-lock-limit=3', '--wait-on-lock-interval=3']

signums = [
(signal.SIGABRT, SystemExit),
Expand All @@ -3766,15 +3768,15 @@ def __exit__(self, type, value, traceback):
# avoid recycling stderr of previous test
stderr = ''

with WaitAndSignal(1, signum):
with WaitAndSignal(3, signum):

# change back to original working directory before each test
change_dir(orig_wd)

self.mock_stderr(True)
self.mock_stdout(True)
self.assertErrorRegex(exc, '.*', self._test_toy_build, ec_file=test_ec, verify=False,
raise_error=True, testing=False, raise_systemexit=True)
extra_args=extra_args, raise_error=True, testing=False, raise_systemexit=True)

stderr = self.get_stderr().strip()
self.mock_stderr(False)
Expand Down

0 comments on commit fd6e8b8

Please sign in to comment.