[tools] testbot/WineTest: Always work around explorer's 'fresh WINEPREFIX' bug.

Francois Gouget fgouget at codeweavers.com
Wed Feb 3 11:58:58 CST 2021


WineTest.pl assumed that the wineprefix had been set up by WineReconfig
so that pre-initializing it to work around explorer's 'fresh WINEPREFIX'
bug (41713) was not necessary. But that's no longer true so make sure
to always fully initialize the wineprefix before starting any test.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48671
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

I expect this will shave 6 to 8 minutes off the WineTest run time. That 
means it will probably still time out but I'll reassess the situation 
once this patch is in.

 testbot/bin/build/WineTest.pl | 41 +++++++++++++----------------------
 1 file changed, 15 insertions(+), 26 deletions(-)

diff --git a/testbot/bin/build/WineTest.pl b/testbot/bin/build/WineTest.pl
index 84ba1cb0a..dd41fcf67 100755
--- a/testbot/bin/build/WineTest.pl
+++ b/testbot/bin/build/WineTest.pl
@@ -63,6 +63,18 @@ sub SetupTest($$)
   my $BaseName = SetupWineEnvironment($Mission);
   InfoMsg "\nRunning $Test in the $BaseName Wine\n";
   InfoMsg "LANG=$ENV{LANG}\n";
+
+  if (!-d $ENV{WINEPREFIX})
+  {
+    # FIXME Wait for the wineserver as a workaround for bug 41713.
+    my $ErrMessage = CreateWinePrefix($Mission, "wait");
+    if (defined $ErrMessage)
+    {
+      LogMsg "Could not create the $BaseName wineprefix: $ErrMessage\n";
+      return 0;
+    }
+  }
+
   return $BaseName;
 }
 
@@ -70,10 +82,9 @@ sub WineTestSuite($$$$)
 {
   my ($Mission, $NoSubmit, $BaseTag, $Args) = @_;
 
-  my $BaseName = SetupTest("WineTest", $Mission);
-
   # Run WineTest. Ignore the exit code since it returns non-zero whenever
   # there are test failures.
+  my $BaseName = SetupTest("WineTest", $Mission);
   my $Tag = SanitizeTag("$BaseTag-$BaseName");
   RunWine($Mission, "winetest.exe",
           "-c -o '$DataDir/$BaseName.report' -t $Tag ". ShArgv2Cmd(@$Args));
@@ -128,20 +139,9 @@ sub TestPatch($$)
     return 1 if (!@TestList);
   }
 
-  my $BaseName = SetupTest("the tests", $Mission);
-  if (!-d $ENV{WINEPREFIX})
-  {
-    # FIXME Wait for the wineserver as a workaround for bug 41713.
-    my $ErrMessage = CreateWinePrefix($Mission, "wait");
-    if (defined $ErrMessage)
-    {
-      LogMsg "Could not create the $BaseName wineprefix: $ErrMessage\n";
-      return 0;
-    }
-  }
-
   # Run WineTest. Ignore the exit code since it returns non-zero whenever
   # there are test failures.
+  my $BaseName = SetupTest("the tests", $Mission);
   RunWine($Mission, "winetest.exe",
           "-c -o '$DataDir/$BaseName.report' -t do.not.submit ".
           join(" ", @TestList));
@@ -177,18 +177,7 @@ sub TestExe($$$)
   my ($Mission, $FileName, $Args) = @_;
 
   my $BaseName = SetupTest("the tests", $Mission);
-  if (!-d $ENV{WINEPREFIX})
-  {
-    # FIXME Wait for the wineserver as a workaround for bug 41713.
-    my $ErrMessage = CreateWinePrefix($Mission, "wait");
-    if (defined $ErrMessage)
-    {
-      LogMsg "Could not create the $BaseName wineprefix: $ErrMessage\n";
-      return 0;
-    }
-  }
-
-  my $TestDir = GetTestDir($Mission);
+  my $TestDir = GetTestDir($Mission); # needs $WINEPREFIX
   if ($TestDir eq ".")
   {
     $FileName = "$DataDir/staging/$FileName";
-- 
2.20.1



More information about the wine-devel mailing list