Skip to content

Commit

Permalink
nixos tests: retry: Count down to 0, and pass remaining attempts to t…
Browse files Browse the repository at this point in the history
…he sub

Allows test functions to output diagnostic information on failure.
  • Loading branch information
grahamc committed Jun 21, 2017
1 parent d04286b commit 56435c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/lib/test-driver/Machine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ sub waitForMonitorPrompt {
sub retry {
my ($coderef) = @_;
my $n;
for ($n = 0; $n < 900; $n++) {
return if &$coderef;
for ($n = 899; $n >=0; $n--) {
return if &$coderef($n);
sleep 1;
}
die "action timed out after $n seconds";
Expand Down

0 comments on commit 56435c1

Please sign in to comment.