Skip to content

Commit

Permalink
Shorten test timeout
Browse files Browse the repository at this point in the history
Maybe the shutdown takes too long if the tool still runs ?
  • Loading branch information
mvdbeek committed Oct 28, 2023
1 parent e834939 commit df01218
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/data/tools/timeout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<description>just wastes time</description>
<command detect_errors="exit_code"><![CDATA[
echo "output" > '$output' &&
sleep 30;
sleep 5;
]]></command>
<inputs>
</inputs>
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cmd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def test_tool_test_timeout(self):
with open(json_out.name) as fh:
tool_test_json = json.load(fh)
assert tool_test_json["summary"]["num_tests"] == 1
# check run time, for smaller 10 since the test will take a bit longer than 1s
# the important bit is that it's not about 30s (since the test tool calls `sleep 30`)
# check run time, for smaller 4 since the test will take a bit longer than 1s
# the important bit is that it's not about 5s (since the test tool calls `sleep 5`)
assert (
float(tool_test_json["tests"][0]["data"]["time_seconds"]) <= 10
float(tool_test_json["tests"][0]["data"]["time_seconds"]) <= 4
), "Test needed more than 10 sec but should time out after 1"
assert (
"Timed out after" in tool_test_json["tests"][0]["data"]["output_problems"][0]
Expand Down

0 comments on commit df01218

Please sign in to comment.