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

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