From: Galen Charlton Date: Thu, 16 Aug 2012 17:23:49 +0000 (-0400) Subject: bug 8649: make sure we can exit if a test fails X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=6a82961a11ca39b9684b922cc9a59e29a8d57f22;p=koha.git bug 8649: make sure we can exit if a test fails Signed-off-by: Galen Charlton Signed-off-by: wajasu Signed-off-by: Kyle M Hall --- diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 242f259ea5..e949050f6e 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;