It only makes sense to defer errors until we have retrieved the reconfiguration log, at which point we either clear errors if it indicates success, or handle any previous error. Retrieving any binaries and data files should come after that. This avoids using an undefined $NewStatus when connection errors occur.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/WineRunReconfig.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl index 2c8acdd6..dcf36f8a 100755 --- a/testbot/bin/WineRunReconfig.pl +++ b/testbot/bin/WineRunReconfig.pl @@ -413,6 +413,16 @@ elsif (!defined $TAError) $TAError = "An error occurred while retrieving the reconfig log: ". $TA->GetLastError(); }
+# Report the reconfig errors even though they may have been caused by +# TestAgent trouble. +LogTaskError($ErrMessage) if (defined $ErrMessage); +FatalTAError(undef, $TAError) if (defined $TAError); + + +# +# Grab the test executables and reference files +# + if ($NewStatus eq "completed") { use File::Copy; @@ -427,7 +437,7 @@ if ($NewStatus eq "completed") } elsif (!defined $TAError) { - $TAError = "An error occurred while retrieving the $Bitness bit TestLauncher: ". $TA->GetLastError(); + FatalTAError($TA, "An error occurred while retrieving the $Bitness bit TestLauncher"); } } } @@ -441,18 +451,13 @@ if ($NewStatus eq "completed") } elsif (!defined $TAError) { - $TAError = "An error occurred while retrieving '$TaskDir/$FileName': ". $TA->GetLastError(); + FatalTAError($TA, "An error occurred while retrieving '$TaskDir/$FileName'"); } } }
$TA->Disconnect();
-# Report the reconfig errors even though they may have been caused by -# TestAgent trouble. -LogTaskError($ErrMessage) if (defined $ErrMessage); -FatalTAError(undef, $TAError) if (defined $TAError); -
# # Update the build VM's snapshot