From: Stefan Metzmacher Date: Thu, 21 Jun 2018 04:31:03 +0000 (+0200) Subject: python/tests: make the test_assoc_group_fail2() test more resilient against timing X-Git-Tag: tevent-0.9.37~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d08efa7f90e97f1f797d09f7519076646110cb45;p=thirdparty%2Fsamba.git python/tests: make the test_assoc_group_fail2() test more resilient against timing 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 Reviewed-by: Ralph Boehme --- diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py index ff815e97ca6..7cc3a4a29b5 100755 --- a/python/samba/tests/dcerpc/raw_protocol.py +++ b/python/samba/tests/dcerpc/raw_protocol.py @@ -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,