Skip to content

Commit

Permalink
Fixes #1507: suppress libwebsocket logging races and update tests (#1524
Browse files Browse the repository at this point in the history
)

* Issue #1507: update http test for deprecation warning

* fixup: suppress it

* fixup: more libws suppressions

* fixup: even more libwebsockets logging races
  • Loading branch information
kgiusti authored Jun 17, 2024
1 parent b1fadbd commit d823211
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 9 additions & 3 deletions tests/system_tests_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def setUpClass(cls):
@classmethod
def get(cls, url, use_ca=True):
if use_ca:
http_data = urlopen(url, cafile=CA_CERT)
sctxt = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
sctxt.load_verify_locations(cafile=CA_CERT)
http_data = urlopen(url, context=sctxt)
else:
http_data = urlopen(url)
return http_data.read().decode('utf-8')
Expand Down Expand Up @@ -226,7 +228,9 @@ def test_http_metrics(self):

def _test(stat_names, port):
# sanity check that all expected stats are reported
resp = urlopen(f"http://localhost:{port}/metrics", cafile=CA_CERT)
sctxt = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
sctxt.load_verify_locations(cafile=CA_CERT)
resp = urlopen(f"http://localhost:{port}/metrics", context=sctxt)
self.assertEqual(200, resp.getcode())
metrics = [x for x in resp.read().decode('utf-8').splitlines() if not x.startswith("#")]

Expand Down Expand Up @@ -284,7 +288,9 @@ def test_http_healthz(self):
r = self.qdrouterd('metrics-test-router', config)

def test(port):
result = urlopen("http://localhost:%d/healthz" % port, cafile=CA_CERT)
sctxt = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT)
sctxt.load_verify_locations(cafile=CA_CERT)
result = urlopen("http://localhost:%d/healthz" % port, context=sctxt)
self.assertEqual(200, result.getcode())

# Sequential calls on multiple ports
Expand Down
15 changes: 9 additions & 6 deletions tests/tsan.supp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ race:^qdr_link_process_deliveries$
# ISSUE-65
race:^qdr_delivery_continue_CT$

# ISSUE-543
race:^_lws_log$
race:^_lws_logv$
race:^__lws_logv$

#
# External libraries
#
Expand All @@ -91,8 +86,16 @@ race:^listener_final_free$
race:^pn_logger_reset_mask$
race:^pni_logger_log$

# DISPATCH-2151
# libwebsockets logging is the king of races:
# DISPATCH-2151, ISSUE-543,ISSUE-1507
#
race:^_lws_logv.part.0$
race:^_lws_log$
race:^_lws_logv$
race:^__lws_logv$
race:^qd_http_server_listen$
race:^lws_snprintf$
race:^handle_stats_results$

# DISPATCH-2155
race:^qd_connection_manager_delete_listener$
Expand Down

0 comments on commit d823211

Please sign in to comment.