From 2f679196a7c4b6062fd0c1497de7c826f06fcd91 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 16 Aug 2023 12:18:13 -0400 Subject: [PATCH 1/2] tests: fix wait_tcp_port format string. The success-case `print` for the `wait_tcp_port` helper wasn't formatting its message as an f-string, instead printing the literal `{host}` and `{port}` placeholders. --- tests/client-server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/client-server.py b/tests/client-server.py index 9ea753a2..347f54e1 100755 --- a/tests/client-server.py +++ b/tests/client-server.py @@ -32,7 +32,7 @@ def wait_tcp_port(host, port): else: print("client-server.py: unable to connect") sys.exit(1) - print("client-server.py: detected server is up on {host}:{port}") + print(f"client-server.py: detected server is up on {host}:{port}") class Failure(Exception): pass From bc5b29fcdf0dafdefe94900d7a170c93b293b7ca Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Wed, 16 Aug 2023 12:19:24 -0400 Subject: [PATCH 2/2] tests: wait for tcp port for all test types. The `run_mtls_client_tests` and `run_mtls_client_crl_tests` were being run without calling `wait_tcp_port` first. I suspect this is the reason we sometimes see the connect tests fail in CI on some platforms with output about the connection being refused. --- tests/client-server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/client-server.py b/tests/client-server.py index 347f54e1..c3137f11 100755 --- a/tests/client-server.py +++ b/tests/client-server.py @@ -219,6 +219,7 @@ def main(): server_popen = run_server(server, valgrind, { "AUTH_CERT": "testdata/minica.pem", }) + wait_tcp_port(HOST, PORT) run_mtls_client_tests(client, valgrind) server_popen.kill() server_popen.wait() @@ -228,6 +229,7 @@ def main(): "AUTH_CERT": "testdata/minica.pem", "AUTH_CRL": "testdata/test.crl.pem", }) + wait_tcp_port(HOST, PORT) run_mtls_client_crl_tests(client, valgrind)