[PATCH 4/6] bug 8649: make sure we can exit if a test fails
Galen Charlton
gmc at esilibrary.com
Thu Aug 16 19:23:49 CEST 2012
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: wajasu <matted-34813 at mypacks.net>
---
t/db_dependent/Search.t | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t
index 242f259..e949050 100644
--- a/t/db_dependent/Search.t
+++ b/t/db_dependent/Search.t
@@ -502,12 +502,16 @@ warning_like {( undef, $results_hashref, $facets_loop ) =
$results_hashref->{'biblioserver'}->{"RECORDS"});
is($newresults[0]->{'alternateholdings_count'}, 1, 'Alternate holdings filled in correctly');
-kill 9, $child;
+END {
+ if ($child) {
+ kill 9, $child;
-# Clean up the Zebra files since the child process was just shot
+ # Clean up the Zebra files since the child process was just shot
-find(sub { unlink($_) if ( -f $_ && m/\.(mf|pid|LCK)$/ ); }, "$datadir");
-unlink("$datadir/var/run/zebradb/authoritysocket");
-unlink("$datadir/var/run/zebradb/bibliosocket");
+ find(sub { unlink($_) if ( -f $_ && m/\.(mf|pid|LCK)$/ ); }, "$datadir");
+ unlink("$datadir/var/run/zebradb/authoritysocket");
+ unlink("$datadir/var/run/zebradb/bibliosocket");
+ }
+}
1;
--
1.7.11.4
------=_Part_5104_6714174.1345149989434--
More information about the Koha-patches
mailing list