Blame SOURCES/perl-ldap-0.66-test-Remove-a-test-for-cancelling-asynchronous-calls.patch

d9f08c
From 5a2388c895cfd7db5f6ca1cc4acb062dfde336bf Mon Sep 17 00:00:00 2001
d9f08c
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
d9f08c
Date: Thu, 25 Apr 2019 14:23:55 +0200
d9f08c
Subject: [PATCH] test: Remove a test for cancelling asynchronous calls
d9f08c
MIME-Version: 1.0
d9f08c
Content-Type: text/plain; charset=UTF-8
d9f08c
Content-Transfer-Encoding: 8bit
d9f08c
d9f08c
t/60cancel.t performed a racy test when it started an asynchronous query, then
d9f08c
it canceled it and tested that the cancelling succeeded. However, if a server
d9f08c
finished the search before the cancelling order was issued, the cancel itself
d9f08c
failed because it referred an not running and thus then nonexisting query:
d9f08c
d9f08c
    t/60cancel.t .. 1/7
d9f08c
    #   Failed test 'cancel a running operation: 119: message ID not found'
d9f08c
    #   at t/60cancel.t line 63.
d9f08c
    # This test may have failed because the server was too fast
d9f08c
d9f08c
The race was actually admitted in the diag message.
d9f08c
d9f08c
This patch removes the unreliable test to prevent from false negatives.
d9f08c
d9f08c
Signed-off-by: Petr Písař <ppisar@redhat.com>
d9f08c
---
d9f08c
 t/60cancel.t | 17 +----------------
d9f08c
 1 file changed, 1 insertion(+), 16 deletions(-)
d9f08c
d9f08c
diff --git a/t/60cancel.t b/t/60cancel.t
d9f08c
index c72bfa5..8a3074c 100644
d9f08c
--- a/t/60cancel.t
d9f08c
+++ b/t/60cancel.t
d9f08c
@@ -11,7 +11,7 @@ BEGIN { require "t/common.pl" }
d9f08c
 
d9f08c
 
d9f08c
 start_server()
d9f08c
-? plan tests => 7
d9f08c
+? plan tests => 6
d9f08c
 : plan skip_all => 'no server';
d9f08c
 
d9f08c
 
d9f08c
@@ -47,21 +47,6 @@ SKIP: {
d9f08c
   # cancel the finished search => should fail
d9f08c
   $cancel = $ldap->cancel($search);
d9f08c
   ok($cancel->code, "cancel a finished operation: " . $cancel->code . ": " . $cancel->error);
d9f08c
-
d9f08c
-  # switch to async mode
d9f08c
-  $ldap->async(1);
d9f08c
-
d9f08c
-  # perform a search (asynchronously)
d9f08c
-  $search = $ldap->search(
d9f08c
-                       base     => $BASEDN,
d9f08c
-                       filter   => '(objectclass=*)',
d9f08c
-                       callback => \&process_entry, # Call this sub for each entry
d9f08c
-                     );
d9f08c
-
d9f08c
-  # cancel the running search => should work [may fail, as it depends on the server's speed]
d9f08c
-  $cancel = $ldap->cancel($search);
d9f08c
-  ok(!$cancel->code, "cancel a running operation: " . $cancel->code . ": " . $cancel->error)
d9f08c
-    or diag("This test may have failed because the server was too fast");
d9f08c
 }
d9f08c
 
d9f08c
 
d9f08c
-- 
d9f08c
2.20.1
d9f08c