Francois Gouget : testbot: When canceling a job, update its status and reschedule immediately.

Alexandre Julliard julliard at winehq.org
Thu Mar 28 14:44:39 CDT 2013


Module: tools
Branch: master
Commit: 2d5f4a1df2739b7386bf0fafed7cac3559b139f8
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=2d5f4a1df2739b7386bf0fafed7cac3559b139f8

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Mar 28 14:43:23 2013 +0100

testbot: When canceling a job, update its status and reschedule immediately.

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;
 }




More information about the wine-cvs mailing list