[2/3] testbot: When canceling a job, update its status and reschedule immediately.

Francois Gouget fgouget at codeweavers.com
Thu Mar 28 08:43:23 CDT 2013


This is possible now that Job::Cancel() updates the task and VM status when it kills a child process.
Also note that Job::Restart() was synchronous already.
---
 testbot/bin/Engine.pl           |   15 +++++----------
 testbot/lib/WineTestBot/Jobs.pm |    3 ++-
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index 5fcce05..670945a 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -344,16 +344,11 @@ sub HandleJobCancel
     return "0$ErrMessage";
   }
 
-  # Wait a couple of seconds before rescheduling so the child processes have
-  # the time to die.
-  AddEvent("JobCancel$JobKey", 2, 0, sub {
-    $Job->UpdateStatus();
-    $ErrMessage = ScheduleJobs();
-    if (defined($ErrMessage))
-    {
-      LogMsg "Scheduling problem in HandleJobCancel: $ErrMessage\n";
-    }
-  });
+  $ErrMessage = ScheduleJobs();
+  if (defined($ErrMessage))
+  {
+    LogMsg "Scheduling problem in HandleJobCancel: $ErrMessage\n";
+  }
 
   return "1OK";
 }
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index ab82c07..8176015 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -218,7 +218,8 @@ sub Cancel
       }
     }
   }
-  # Let the higher layers handle updating the overall job status
+  # Let UpdateStatus() handle updating the overall job status
+  $self->UpdateStatus();
 
   return undef;
 }
-- 
1.7.10.4




More information about the wine-patches mailing list