Skip to content

Commit

Permalink
fix resubmission tests
Browse files Browse the repository at this point in the history
on the 2nd submission the env variables get lost. For some reason
bash evaluates this as successful even if the if statement crashes.
so actually there are only 2 submissions (1 resubmission), i.e.
multiple resubmissions still do not work.

Hence I suggest to to a "real OOM" resubmission and treat the case
of a lost variable as error.
  • Loading branch information
bernt-matthias committed Jan 15, 2023
1 parent fe88310 commit 0d88e34
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/fixtures/mapping-resubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tools:
mem: 4
resubmit:
with_more_mem_on_failure:
condition: any_failure and attempt <= 3
condition: memory_limit_reached and attempt <= 3
destination: tpv_dispatcher
exit_code_oom_no_resubmit:
cores: 2
Expand Down
11 changes: 9 additions & 2 deletions tests/fixtures/resubmit/exit_code_oom_no_resubmit.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<tool id="exit_code_oom_no_resubmit" name="exit_code_oom_no_resubmit" version="0.1.1" profile="16.04">
<!-- tool errors out with identified OOM error if less than 10MB are allocated. -->
<stdio>
<exit_code range="42" level="fatal_oom" description="Out of Memory" />
</stdio>
<command detect_errors="exit_code" oom_exit_code="42"><![CDATA[
mv hi.txt '$out_file1' &&
echo "\$OOM_TOOL_MEMORY" &&
echo "OOM_TOOL_MEMORY \$OOM_TOOL_MEMORY" &&
if [[ -z \$OOM_TOOL_MEMORY ]]; then
exit 1;
fi &&
if [ "\$OOM_TOOL_MEMORY" -lt 10 ]; then
exit 42;
else
Expand All @@ -17,14 +23,15 @@ fi
<param name="input" type="integer" label="Dummy" value="6" />
</inputs>
<outputs>
<data name="out_file1" />
<data name="out_file1" format="txt" />
</outputs>
<tests>
<test>
<param name="input" value="5" />
<output name="out_file1">
<assert_contents>
<has_line line="Hello" />
<has_line line="OOM_TOOL_MEMORY 16" />
</assert_contents>
</output>
</test>
Expand Down
11 changes: 9 additions & 2 deletions tests/fixtures/resubmit/exit_code_oom_with_resubmit.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<tool id="exit_code_oom_with_resubmit" name="exit_code_oom_with_resubmit" version="0.1.1" profile="16.04">
<!-- tool errors out with identified OOM error if less than 10MB are allocated. -->
<stdio>
<exit_code range="42" level="fatal_oom" description="Out of Memory" />
</stdio>
<command detect_errors="exit_code" oom_exit_code="42"><![CDATA[
mv hi.txt '$out_file1' &&
echo "\$OOM_TOOL_MEMORY" &&
echo "OOM_TOOL_MEMORY \$OOM_TOOL_MEMORY" &&
if [[ -z \$OOM_TOOL_MEMORY ]]; then
exit 1;
fi &&
if [ "\$OOM_TOOL_MEMORY" -lt 10 ]; then
exit 42;
else
Expand All @@ -17,14 +23,15 @@ fi
<param name="input" type="integer" label="Dummy" value="6" />
</inputs>
<outputs>
<data name="out_file1" />
<data name="out_file1" format="txt" />
</outputs>
<tests>
<test>
<param name="input" value="5" />
<output name="out_file1">
<assert_contents>
<has_line line="Hello" />
<has_line line="OOM_TOOL_MEMORY 16" />
</assert_contents>
</output>
</test>
Expand Down

0 comments on commit 0d88e34

Please sign in to comment.