python/tests: make the test_assoc_group_fail2() test more resilient against timing
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Jun 2018 04:31:03 +0000 (06:31 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 10 Jul 2018 18:31:13 +0000 (20:31 +0200)
On a busy system [e]poll() on the server will mark both the
old connection fd and also the listening fd as readable.

epoll() returns the events in order, so the server processes the
disconnect first.

With poll() we don't have an order of the events and the
server is likely to process the connect before the disconnect.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
python/samba/tests/dcerpc/raw_protocol.py

index ff815e97ca637435b4a3204a0fec198e37600892..7cc3a4a29b528c323b16dad093f010be039128e4 100755 (executable)
@@ -18,6 +18,7 @@
 
 import sys
 import os
+import time
 
 sys.path.insert(0, "bin/python")
 os.environ["PYTHONUNBUFFERED"] = "1"
@@ -4930,6 +4931,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ack = self.do_generic_bind(ctx=ctx)
 
         self._disconnect("test_assoc_group_fail2")
+        self.assertNotConnected()
+        time.sleep(0.5)
         self.connect()
 
         ack2 = self.do_generic_bind(ctx=ctx,assoc_group_id=ack.u.assoc_group_id,