$_->rerun for @jobs;
sleep 1 while $db->jobs->search({problem => $id, result_text => undef})->count;
- my (@good_times, @fail_times, $fail);
+ my (%pass, %fail, $fail);
for (@jobs) {
$_->discard_changes;
- my @times = map { $_->{time} } @{decode_json $_->results};
- push @good_times, @times if $_->reference == 0;
- push @fail_times, @times if $_->reference == 3;
+ my $time = max map { $_->{time} } @{decode_json $_->results};
+ $pass{$_->format} = max ($pass{$_->format} // (), $time) if $_->reference == 0;
+ $fail{$_->format} = max ($fail{$_->format} // (), $time) if $_->reference == 3;
if ($_->result == $_->reference) {
say 'Job ' . $_->id . ' OK'
} else {
}
}
- say 'Max time for AC: ' . max @good_times if @good_times;
- say 'Min time for TLE: ' . min @fail_times if @fail_times;
+ printf "Min timeout for %s: %.2fs\n", $_, $pass{$_} for keys %pass;
+ printf "Max timeout for %s: %.2fs\n", $_, $fail{$_} for keys %fail;
say $fail ? 'Test failed' : 'Test successful';
exit $fail if $fail;
}