Skip to contentSkip to conversation

Bisection fix

PATCH New Ian Jackson 1 participant 4 messages May 6, 2015

lore
Share & tools
lore
#0 lore raw

cover Bisection fix

Thanks to Ian C for spotting that the bisector had gone rather awry. It's trying to reproduce on the new hardware passes (which were previously obtained on the old hardware) of tests that are affected by what seem to be hardware-specific bugs in the underlying software.

These patches fix this. I'm about to force push them.

#1 lore raw

PATCH 1/3 cs-bisection-step: Break out report_conflict

We are going to want to reuse this.

Also, explicitly return 0 (for false) from conflicted_warning when it doesn't apply.

No resulting functional change.

---
 cs-bisection-step |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)
cs-bisection-step +19 -12
index c9c8bb6..14f3638 100755
@@ -714,24 +714,31 @@ sub do_choose_this ($) {
     $choose->{Target}= 1;
 }
 
-sub conflicted_warning ($$) {
-    my ($n, $what) = @_;
-    if ($n->{Conflicted}) {
-        my $show_rtuple= $n->{Rtuple};
-        foreach my $flight (@{ $n->{Flights} }) {
-            $show_rtuple .= "\n flight $flight->{Flight}".
-                " (blessed $flight->{Blessing}) result $flight->{Result}";
-        }
-        summary_report(<<END, <<END, 16);
+sub report_conflict ($$$) {
+    my ($n, $what, $desc) = @_;
+    # always returns 1 for the convenience of its callers
+    my $show_rtuple= $n->{Rtuple};
+    foreach my $flight (@{ $n->{Flights} }) {
+	$show_rtuple .= "\n flight $flight->{Flight}".
+	    " (blessed $flight->{Blessing}) result $flight->{Result}";
+    }
+    summary_report(<<END, <<END, 16);
 Not reproducible - supposed $what
 END
 Could not reproduce problem, or could not reproduce basis pass.
-Inconsistent test results at this revision (supposed $what):
+$desc; at this revision (supposed $what):
 $show_rtuple
 END
-        $n->{Target}= 1;
-        return 1;
+    $n->{Target}= 1;
+    return 1;
+}
+
+sub conflicted_warning ($$) {
+    my ($n, $what) = @_;
+    if ($n->{Conflicted}) {
+	return report_conflict($n, $what, 'Inconsistent test results')
     }
+    return 0;
 }
 
 our $repro_lastflight;
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 cs-bisection-step: Report conflict if basis pass/fail are wrong

In reply to Ian Jackson

It can happen that the (for example) supposed basis pass (originally only tested on another host) failed (when reproduced, or for some other reason). When that happens do not attempt to get it to pass; instead, treat it the same way we would if we had actually got conflicting results at that revision.

(Conversely, do not attempt to get a basis fail if the basis fail has already passed on the selected host. This is, as it happens, impossible in a bisection triggered by sg-report-flight with the current invocation arrangements - but cs-bisection-step should handle it correctly.)

---
 cs-bisection-step |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
cs-bisection-step +5 -1
index 14f3638..4200c16 100755
@@ -771,7 +771,11 @@ sub need_repro ($$$) {
     my $fl= $n->{Flights} || [];
     foreach my $f (sort { $a->{Flight} <=> $b->{Flight} } @$fl) {
         next unless $f->{Flight} > $repro_lastflight;
-        next unless $f->{Result} eq $st;
+	if ($f->{Result} ne $st) {
+	    return report_conflict($n, $what, 'Unexpected test results')
+		if $f->{Result} =~ m/^(?:pass|fail)$/;
+	    next;
+	}
         print STDERR " ".
             ($repro_count ? "Repro" : "Result").
             " found: flight $f->{Flight} ($st), for $what\n";
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/3 cs-bisection-step: Abandon repro attempts after a bit

In reply to Ian Jackson

If we have had a number of attempts at a repro, and none of them have produced a pass or fail, something is probably wrong and we should give up rather than carrying on.

Handle this with the machinery we use for conflicting test results.

---
 cs-bisection-step |    4 ++++
 1 file changed, 4 insertions(+)
cs-bisection-step +4 -0
index 4200c16..192bbe7 100755
@@ -769,6 +769,10 @@ sub need_repro ($$$) {
     return 1 if conflicted_warning($n, $what);
 
     my $fl= $n->{Flights} || [];
+
+    return report_conflict($n, $what, 'Too many attempts')
+	if @$fl > 5;
+
     foreach my $f (sort { $a->{Flight} <=> $b->{Flight} } @$fl) {
         next unless $f->{Flight} > $repro_lastflight;
 	if ($f->{Result} ne $st) {
Signature · 1 line
1.7.10.4