Priority: Normal
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Extension
Component: UnitTestContrib, Configure
Branches: Release01x01 trunk
Sven built up a new minimal test machine and the unit tests were "apparently" hanging with no out from or beyond the Fn_SEARCH tests.
Actually all of the unit test output was being captured into the worker output from search.
The root cause appears to be the
ConfigureTests for installing a zip archive. If the perl
Archive::Zip
is not installed, Foswiki::Configure::Util then attempts to use the system provided unzip tool. If unzip is
also missing, then something gets messed up in the capturing of stdout / stderr.
... unzip using Archive::Zip unless not available ...
else {
eval {
my $out = `unzip -n $archive`;
die "$? - $!" if ($?);
1;
} or do {
$error = "unzip failed $@ \n";
};
}
return $error;
After this code runs and returns the error - that zip is not found, the
TestRunner appears to get lost capturing output, and it becomes more obvious when Fn_SEARCH runs. If you tail the worker capture file, it is getting ALL of the test output.
The simple workaround is to either install unzip or Archive::Zip, but something else is wrong.
--
GeorgeClark - 17 Sep 2012
Babar found the solution.
(10:42:22 AM) Babar: http://perldoc.perl.org/perl5140delta.html#Exception-Handling
(10:42:42 AM) Babar: but... resetting $@ to '' at the end of the eval _might_ help
(10:50:10 AM) gac410: Cool Babar, resetting $@ seems to fix the unit tests.
(10:50:28 AM) gac410: At least stdout doesn't get stuck
(10:50:53 AM) Babar: (don't thank me, thank Vincent Pit who suggested it)