diff mbox series

[OSSTEST,v2,17/17] cr-daily-branch: Heuristics for when to do immediate retest flight

Message ID 20201015155019.20705-18-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Immediately retry failing tests | expand

Commit Message

Ian Jackson Oct. 15, 2020, 3:50 p.m. UTC
Do not do a retest if it would involve retesting more than 10% of the
original flight, or if it wouldn't get a push even if the retests
pass.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 cr-daily-branch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/cr-daily-branch b/cr-daily-branch
index 9b1961bd..e54ca227 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -497,11 +497,26 @@  while true; do
 	OSSTEST_IMMEDIATE_RETRY=false
 	retry_jobs=$(
 		perl <$mrof -wne '
+			$n_blockers = $1 if m/^nblockers (\d+)\s*$/;
+			$n_jobs     = $1 if m/^njobs (\d+)\s*$/;
 			next unless m/^regression (\S+) /;
 			my $j = $1;
 			next if $j =~ m/^build/;
 			$r{$j}++;
+			sub nope {
+				print STDERR "no retry: @_\n";
+				exit 0;
+			}
 			END {
+				my $n_retry_jobs = scalar(keys %r);
+ 				print STDERR <<"END";
+n_retry_jobs=$n_retry_jobs n_blockers=$n_blockers n_jobs=$n_jobs
+END
+				nope("other blockers") if 
+                                        $n_retry_jobs < $n_blockers;
+				nope("too many regressions") if
+					$n_retry_jobs > 1 &&
+					$n_retry_jobs > $n_jobs/10;
 				print "copy-jobs '$flight' $_ "
 					foreach sort keys %r;
 			}'