complete error timeout handling for all tests
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Test / Search / Boolean.pm
index c5d15c0..ea8233a 100644 (file)
@@ -1,4 +1,3 @@
-# $Id: Boolean.pm,v 1.3 2006-10-26 10:24:20 sondberg Exp $
 
 # See the "Main" test package for documentation
 
@@ -25,7 +24,7 @@ sub start {
     foreach my $operator (keys %pqfs) {
        $conn->irspy_search_pqf($pqfs{$operator},
                                 {'operator' => $operator}, {},
-                               ZOOM::Event::RECV_SEARCH, \&found,
+                               ZOOM::Event::ZEND, \&found,
                                exception => \&error);
     }
 }
@@ -34,8 +33,9 @@ sub start {
 sub found {
     my($conn, $task, $test_args, $event) = @_;
     my $operator = $test_args->{'operator'};
-    my $n = $task->{rs}->size();
 
+    my $n = $task->{rs}->size();
+    $task->{rs}->destroy();
     $conn->log("irspy_test", "search using boolean operator ", $operator,
                              " found $n record", $n==1 ? "" : "s");
     update($conn, $operator, 1);
@@ -48,9 +48,11 @@ sub error {
     my($conn, $task, $test_args, $exception) = @_;
     my $operator = $test_args->{'operator'};
 
+    $task->{rs}->destroy();
     $conn->log("irspy_test", "search using boolean operator ", $operator,
                              " had error: ", $exception);
     update($conn, $operator, 0);
+    zoom_error_timeout_update($conn, $exception);
     return ZOOM::IRSpy::Status::TASK_DONE;
 }