From 528394b2744efe4615cca700488694039d513945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sun, 15 Jun 2025 17:31:22 +0300 Subject: [PATCH] Fix Firefox browser test run, and improve debugging of multiple received responses during test run. --- test/common.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/common.py b/test/common.py index b3a6641598dca..b382a7ff88af2 100644 --- a/test/common.py +++ b/test/common.py @@ -2236,6 +2236,9 @@ def log_request(code=0, size=0): # allows streaming compilation to work SimpleHTTPRequestHandler.extensions_map['.wasm'] = 'application/wasm' + # Firefox browser security does not allow loading .mjs files if they + # do not have the correct MIME type + SimpleHTTPRequestHandler.extensions_map['.mjs'] = 'text/javascript' httpd = HTTPServer(('localhost', port), TestServerHandler) httpd.serve_forever() # test runner will kill us @@ -2323,9 +2326,10 @@ def is_browser_test(self): def assert_out_queue_empty(self, who): if not self.harness_out_queue.empty(): + responses = [] while not self.harness_out_queue.empty(): - self.harness_out_queue.get() - raise Exception('excessive responses from %s' % who) + responses += [self.harness_out_queue.get()] + raise Exception('excessive responses from %s: %s' % (who, '\n'.join(responses))) # @param extra_tries: how many more times to try this test, if it fails. browser tests have # many more causes of flakiness (in particular, they do not run