Skip to content

Commit 144c28e

Browse files
committed
disable alarm signal in contextmanager used in test_toy_lock_cleanup_signals
1 parent cf9fd79 commit 144c28e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/framework/toy_build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,8 @@ def __enter__(self):
28672867
signal.alarm(self.seconds)
28682868

28692869
def __exit__(self, type, value, traceback):
2870-
pass
2870+
# cancel scheduled alarm (just for cleanup sake)
2871+
signal.alarm(0)
28712872

28722873
# add extra sleep command to ensure session takes long enough
28732874
test_ecs_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs')
@@ -2883,7 +2884,12 @@ def __exit__(self, type, value, traceback):
28832884
(signal.SIGQUIT, SystemExit),
28842885
]
28852886
for (signum, exc) in signums:
2887+
2888+
# avoid recycling stderr of previous test
2889+
stderr = ''
2890+
28862891
with wait_and_signal(1, signum):
2892+
28872893
self.mock_stderr(True)
28882894
self.mock_stdout(True)
28892895
self.assertErrorRegex(exc, '.*', self.test_toy_build, ec_file=test_ec, verify=False,

0 commit comments

Comments
 (0)