[Tools 1/3] testbot: Keep failed task files around until they are rerun.

Francois Gouget fgouget at codeweavers.com
Sun Jan 8 17:56:43 CST 2017


When a task needs to be rerun, typically due to a problem with the VM
host, keep its files around until it actually gets rerun.
This makes it possible to access its logs until then.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/WineRunBuild.pl      | 3 +--
 testbot/bin/WineRunReconfig.pl   | 3 +--
 testbot/bin/WineRunTask.pl       | 3 +--
 testbot/lib/WineTestBot/Tasks.pm | 4 +++-
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index d410949d..07572479 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -39,7 +39,6 @@ sub BEGIN
 my $Name0 = $0;
 $Name0 =~ s+^.*/++;
 
-use File::Path;
 
 use WineTestBot::Config;
 use WineTestBot::Jobs;
@@ -203,7 +202,7 @@ sub WrapUpAndExit($)
   {
     $Task->Started(undef);
     $Task->Ended(undef);
-    Error "Unable to delete '$TaskDir': $!\n" if (!rmtree($TaskDir));
+    # Leave the Task files around so they can be seen until the next run
   }
   else
   {
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index cc07359a..2c8e2fb7 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -39,7 +39,6 @@ sub BEGIN
 my $Name0 = $0;
 $Name0 =~ s+^.*/++;
 
-use File::Path;
 
 use WineTestBot::Config;
 use WineTestBot::Jobs;
@@ -203,7 +202,7 @@ sub WrapUpAndExit($)
   {
     $Task->Started(undef);
     $Task->Ended(undef);
-    Error "Unable to delete '$TaskDir': $!\n" if (!rmtree($TaskDir));
+    # Leave the Task files around so they can be seen until the next run
   }
   else
   {
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index d703d391..875213bd 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -38,7 +38,6 @@ sub BEGIN
 my $Name0 = $0;
 $Name0 =~ s+^.*/++;
 
-use File::Path;
 
 use WineTestBot::Config;
 use WineTestBot::Jobs;
@@ -231,7 +230,7 @@ sub WrapUpAndExit($;$)
   {
     $Task->Started(undef);
     $Task->Ended(undef);
-    Error "Unable to delete '$TaskDir': $!\n" if (!rmtree($TaskDir));
+    # Leave the Task files around so they can be seen until the next run
   }
   else
   {
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 6ba23a75..8020bd0f 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -33,6 +33,7 @@ virtual machine that the test must be performed in.
 =cut
 
 use POSIX qw(:errno_h);
+use File::Path;
 use ObjectModel::BackEnd;
 use WineTestBot::Config;
 use WineTestBot::Jobs;
@@ -108,8 +109,9 @@ sub Run($$)
     # Capture Perl errors in the task's generic error log
     my ($JobId, $StepNo, $TaskNo) = @{$self->GetMasterKey()};
     my $TaskDir = "$DataDir/jobs/$JobId/$StepNo/$TaskNo";
+    # Remove the previous run's files if any
+    rmtree $TaskDir;
     mkdir $TaskDir;
-    unlink "$TaskDir/err"; # truncate the log since this is a new run
     if (open(STDERR, ">>", "$TaskDir/err"))
     {
       # Make sure stderr still flushes after each print
-- 
2.11.0




More information about the wine-patches mailing list