diff --git a/tests/system_test.py b/tests/system_test.py index c86e30b2d..8d047e035 100755 --- a/tests/system_test.py +++ b/tests/system_test.py @@ -1532,14 +1532,17 @@ def __init__(self, address, source, conn_args=None, container_id=None, self._thread.start() self.num_queue_puts = 0 self.num_queue_gets = 0 + self.queue_stats = "self.num_queue_puts=%d, self.num_queue_gets=%d" self._error = None if wait: ready = self._ready.wait(timeout=TIMEOUT) if ready is False: + self._logger.log("AsyncTestReceiver connection attempt timed out") raise AsyncTestReceiver.TestReceiverException("Timed out waiting for receiver start") elif self._error is not None: + self._logger.log("AsyncTestReceiver connection attempt failed, error=%s" % self._error) raise AsyncTestReceiver.TestReceiverException(self._error) - self.queue_stats = "self.num_queue_puts=%d, self.num_queue_gets=%d" + self._logger.log("AsyncTestReceiver thread running") def get_queue_stats(self): return self.queue_stats % (self.num_queue_puts, self.num_queue_gets) @@ -1558,7 +1561,7 @@ def _main(self): def on_transport_error(self, event): self._logger.log("AsyncTestReceiver on_transport_error=%s" % event.transport.condition.description) - self._error = f"Connection Error: {event.transport.condition.description}" + self._error = f"Transport Error: {event.transport.condition.description}" self._stop_thread = True def on_connection_error(self, event): @@ -1572,15 +1575,19 @@ def on_link_error(self, event): self._stop_thread = True def stop(self, timeout=TIMEOUT): + self._logger.log("AsyncTestReceiver stopping") self._stop_thread = True self._container.wakeup() self._thread.join(timeout=TIMEOUT) if self._thread.is_alive(): + self._logger.log("AsyncTestReceiver did not stop!") raise AsyncTestReceiver.TestReceiverException("AsyncTestReceiver did not exit") del self._conn del self._container if self._error is not None: + self._logger.log("AsyncTestReceiver failed with error=%s" % self._error) raise AsyncTestReceiver.TestReceiverException(self._error) + self._logger.log("AsyncTestReceiver stopped!") def on_start(self, event): kwargs = {'url': self.address} diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py index d80a45ed3..41831c7ab 100644 --- a/tests/system_tests_ssl.py +++ b/tests/system_tests_ssl.py @@ -1101,7 +1101,8 @@ def test_ssl_client_profile_update(self): test_rx = AsyncTestReceiver(f"amqps://localhost:{self.listener1_port}", source="test/addr", container_id="FooRx", - conn_args=conn_args) + conn_args=conn_args, + print_to_console=True) ssl_domain = SSLDomain(SSLDomain.MODE_CLIENT) ssl_domain.set_trusted_ca_db(CA2_CERT) @@ -1154,7 +1155,8 @@ def test_ssl_client_profile_update(self): atr = AsyncTestReceiver(f"amqps://localhost:{self.listener1_port}", source="test/addr", container_id="FooRx2", - conn_args=conn_args) + conn_args=conn_args, + print_to_console=True) atr.stop() self.assertIn("certificate verify failed", str(exc.exception), f"{exc.exception}") @@ -1169,7 +1171,8 @@ def test_ssl_client_profile_update(self): atr = AsyncTestReceiver(f"amqps://localhost:{self.listener2_port}", source="test/addr", container_id="FooRx3", - conn_args=conn_args) + conn_args=conn_args, + print_to_console=True) atr.stop() self.assertIn("certificate verify failed", str(exc.exception), f"{exc.exception}") @@ -1187,7 +1190,8 @@ def test_ssl_client_profile_update(self): test_rx = AsyncTestReceiver(f"amqps://localhost:{self.listener1_port}", source="test/addr", container_id="FooRxOk", - conn_args=conn_args) + conn_args=conn_args, + print_to_console=True) ssl_domain = SSLDomain(SSLDomain.MODE_CLIENT) ssl_domain.set_trusted_ca_db(CA_CERT)