Skip to content

Commit f060040

Browse files
committed
Avoid blocking test if running without timeout implementation
1 parent c8d08a9 commit f060040

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/framework/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,15 +1746,15 @@ def test_run_shell_cmd_timeout_stream(self):
17461746
"""Test use of run_shell_cmd with a timeout."""
17471747
data = '0'*128
17481748
# Failure on process timeout
1749-
cmd = f'while true; do echo {data} && sleep 0.1; done'
1749+
cmd = f'for i in {{1..20}}; do echo {data} && sleep 0.1; done'
17501750
with self.mocked_stdout_stderr():
17511751
self.assertErrorRegex(
17521752
EasyBuildError, "Timeout during `.*` after .* seconds",
17531753
run_shell_cmd, cmd, timeout=.5, stream_output=True
17541754
)
17551755

17561756
# Failure on stdout read timeout
1757-
cmd = 'cat -'
1757+
cmd = 'timeout 1 cat -'
17581758
with self.mocked_stdout_stderr():
17591759
self.assertErrorRegex(
17601760
EasyBuildError, "Timeout during `.*` after .* seconds",

0 commit comments

Comments
 (0)