Skip to content

Commit

Permalink
CI: Propagate EchoClientRunner exceptions to the caller (#1644)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgiusti authored Oct 22, 2024
1 parent 13fa9c0 commit 7c8bfa9
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions tests/system_tests_tcp_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,23 @@ def __init__(self, test_name, client_n, logger, client, server, size,
'CLIENT_PRIVATE_KEY_PASSWORD': CLIENT_PRIVATE_KEY_PASSWORD,
'CA_CERT': CA_CERT}

try:
self.e_client = TcpEchoClient(prefix=self.client_prefix,
host='localhost',
port=self.listener_port,
size=self.size,
count=self.count,
timeout=self.timeout,
logger=self.client_logger,
ssl_info=ssl_info,
delay_close=delay_close)

except Exception as exc:
self.e_client.error = "TCP_TEST TcpAdaptor_runner_%s failed. Exception: %s" % \
(self.name, traceback.format_exc())
self.logger.log(self.e_client.error)
raise Exception(self.e_client.error)
self.e_client = TcpEchoClient(prefix=self.client_prefix,
host='localhost',
port=self.listener_port,
size=self.size,
count=self.count,
timeout=self.timeout,
logger=self.client_logger,
ssl_info=ssl_info,
delay_close=delay_close)

def wait(self):
"""
Block until the client completes. An exception is raised if the client
failed.
"""
self.e_client.wait()
if self.e_client is not None:
self.e_client.wait()


class TcpAdaptorBase(TestCase):
Expand Down

0 comments on commit 7c8bfa9

Please sign in to comment.