qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [qpid-dispatch] branch master updated: DISPATCH-1383: Policy tests hanging on some platforms - init race
Date Mon, 08 Jul 2019 14:07:40 GMT
This is an automated email from the ASF dual-hosted git repository.

chug pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new f227669  DISPATCH-1383: Policy tests hanging on some platforms - init race
f227669 is described below

commit f22766996be12f5a0d6b388d04be6d7ccad1eb80
Author: Chuck Rolke <chug@apache.org>
AuthorDate: Mon Jul 8 10:05:49 2019 -0400

    DISPATCH-1383: Policy tests hanging on some platforms - init race
    
    Policy tests have a subclass of FakeBroker.
    At the start of subclass init the code calls FakeBroker init.
    FakeBroker init starts a thread that runs the main loop.
    
    In the failing cases the FakeBroker main loop runs before the
    sublcasses complete their init functions. Then the main loop
    fails because class variables don't exist yet.
    
    The fix is to defer running FakeBroker init until the end of subclass init.
    
    This closes #534
---
 tests/system_tests_policy.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/system_tests_policy.py b/tests/system_tests_policy.py
index 1f08f05..982ca75 100644
--- a/tests/system_tests_policy.py
+++ b/tests/system_tests_policy.py
@@ -1204,11 +1204,11 @@ class ConnectorPolicyMisconfiguredClient(FakeBroker):
     causes an immediate connection close.
     '''
     def __init__(self, url, container_id=None):
-        super(ConnectorPolicyMisconfiguredClient, self).__init__(url, container_id)
         self.connection_opening = 0
         self.connection_opened = 0
         self.connection_error = 0
         self.main_exited = False
+        super(ConnectorPolicyMisconfiguredClient, self).__init__(url, container_id)
 
     def _main(self):
         self._container.timeout = 1.0
@@ -1315,7 +1315,6 @@ class ConnectorPolicyClient(FakeBroker):
     allows certain sources and targets.
     '''
     def __init__(self, url, container_id=None):
-        super(ConnectorPolicyClient, self).__init__(url, container_id)
         self.connection_opening = 0
         self.connection_opened = 0
         self.connection_error = 0
@@ -1329,6 +1328,7 @@ class ConnectorPolicyClient(FakeBroker):
         self.req_close_sender = False
         self.req_close_receiver = False
         self.req_anonymous_sender = False
+        super(ConnectorPolicyClient, self).__init__(url, container_id)
 
     def _main(self):
         self._container.timeout = 1.0


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message