]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Job truncation: Tolerate `truncated' job status
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 15 Jul 2016 14:08:20 +0000 (15:08 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 18 Jul 2016 14:22:21 +0000 (15:22 +0100)
We are going to introduce a new `truncated' job status, which means
that the job went OK until sg-run-job decided not to continue with it
because it had done all that was requested.

(This will be used for bisection, to stop a bisection job after the
step of interest.)

Its properties are:

 * In summary HTML `truncated' shows up as a green job status, like `pass'.

 * The duration estimator _does_ look at truncated jobs.  (Note that
   it only looks on the specific branch, so only when organising a
   bisection will it look at bisections.)

 * Consequently the host allocator for bisections will expect the
   duration to be that of the last flight where this job passed,
   failed or was truncated, which is correct.

 * When the host allocator is choosing a host for non-bisections it
   won't consider these truncated jobs because they ought not to
   appear in main branch flights.  If they do they count more as
   fails than (that is, they do make the job sticky).

 * sg-execute-flight expects that sg-run-job might set the job
   status to `truncated' and then exit with status 0.

 * sg-report-flight does not look for an interesting failing step
   when the job is truncated (ie for this purpose it's like pass).

 * sg-report-flight doesn't consider truncated jobs to indicate
   trouble, and handles truncated properly in Subject line generation.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/Executive.pm
sg-execute-flight
sg-report-flight
ts-hosts-allocate-Executive

index 468031c3d8e0b0b669e571bae015941088e28cbb..1ee36da40b18459eabeb81bcac990ada7520e477 100644 (file)
@@ -303,7 +303,7 @@ sub report_run_getinfo ($) {
        };
     };
 
-    if ($status eq 'pass') {
+    if ($status eq 'pass' or $status eq 'truncated') {
         return $single->("($status)", $green);
     } elsif ($status eq 'fail' or $status eq 'broken') {
        my $failcolour = $status eq 'fail' ? $red : $yellow;
@@ -1036,7 +1036,8 @@ sub duration_estimator ($$;$) {
                       AND  f.branch=?
                       AND  j.job=?
                       AND  r.val=?
-                     AND  (j.status='pass' OR j.status='fail')
+                     AND  (j.status='pass' OR j.status='fail' OR
+                            j.status='truncated')
                       AND  f.started IS NOT NULL
                       AND  f.started >= ?
                  ORDER BY f.started DESC
index 4e3fcf22ce4e0eef95882f764d100c2d67066350..7c3cf37939f1165cc60b2b8c41df906ab0f686c8 100755 (executable)
@@ -186,7 +186,7 @@ proc main_iteration {} {
         if {!$found} { error "job not in database $flight $job" }
 
         switch -exact -- $jobinfo(status) {
-            pass - fail - broken - blocked {
+            pass - fail - broken - blocked - truncated {
             }
             queued - preparing - running {
                 jobdb::job-set-status-unlocked $flight $job broken
index 99bde92b74c754c458b7e45da43189acac4c8160..de1fd14912da01e3ecfe00eaf076dbb035450a97 100755 (executable)
@@ -487,7 +487,8 @@ END
             $grid{ $j->{job} }[ $gridrow ]= $fi;
        }
 
-        if ($j->{status} ne 'pass' and !$foundfail) {
+        if ($j->{status} ne 'pass' and $j->{status} ne 'truncated'
+           and !$foundfail) {
             $storefail->({
                 stepno => '',
                 status => "$j->{status}",
@@ -518,9 +519,11 @@ END
     my $outcome;
     if ($outcomes eq 'pass') {
         $outcome= 'all pass';
+    } elsif ($outcomes =~ m,^(?:pass/)?truncated$,) {
+        $outcome= 'truncated';
     } elsif ($outcomes eq 'fail') {
         $outcome= 'ALL FAIL';
-    } elsif ($outcomes =~ m,^(?:blocked/)?(?:fail/)?pass$,) {
+    } elsif ($outcomes =~ m,^(?:blocked/)?(?:fail/)?pass(?:/truncated)?$,) {
         $outcome= 'FAIL';
     } else {
         $outcome= "trouble: $outcomes";
@@ -692,7 +695,7 @@ END
     }
 
     if (!%{ $r->{Failures} }) {
-        bodyprint "All tests in this flight passed";
+        bodyprint "All tests in this flight passed as required";
     }
     bodyprint "\n";
 
index 13a065289e2dcf5a93af5b635179e2945730a19c..bc622113f32c07ef5ca24121ee15ad4b041a0002 100755 (executable)
@@ -524,9 +524,9 @@ sub hid_recurse ($$) {
            !defined($duration) ||
            defined($cand->{Duration}) && $cand->{Duration} >= $duration;
         $previously_failed++ if
-           ($cand->{MostRecentStatus} // '') eq 'fail';
+           ($cand->{MostRecentStatus} // '') =~ m/^(?:fail|truncated)/;
        $previously_failed_equiv++ if
-           ($cand->{EquivMostRecentStatus} // '') eq 'fail';
+           ($cand->{EquivMostRecentStatus} // '') =~ m/^(?:fail|truncated)/;
     }
     my $duration_rightaway_adjust= 0;