Module: tools Branch: master Commit: efd987b4035a717401760075dd89acedf9512c58 URL: http://source.winehq.org/git/tools.git/?a=commit;h=efd987b4035a717401760075d...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Jan 9 00:56:43 2017 +0100
testbot: Keep failed task files around until they are rerun.
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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 d410949..0757247 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 cc07359..2c8e2fb 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 d703d39..875213b 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 6ba23a7..8020bd0 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