[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 13/21] TestSupport: Make "broken" set the step state too



Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index e218ff35..8e20244d 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -235,6 +235,17 @@ sub broken ($;$) {
     # must be run outside transaction
     my $affected;
     $newst= 'broken' unless defined $newst;
+    eval {
+       # This is not always effective, but when we really care is
+       # situations where $newst is not `broken' (eg `starved') and
+       # we are running in Executive mode under sg-run-job, and then
+       # this works.  If we are running under sg-run-job, sg-run-job
+       # will set the step status if we don't manage it.
+       my $testid = $ENV{'OSSTEST_TESTID'}
+           || die "OSSTEST_TESTID not set";
+       $mjobdb->step_finish($testid, $newst);
+    };
+    warn "failed to set step status $newst: $@" if $@;
     db_retry($flight,'running', $dbh_tests,[qw(flights)], sub {
         $affected= $dbh_tests->do(<<END, {}, $newst, $flight, $job);
             UPDATE jobs SET status=?
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.