Skip to content

Fix Firefox browser test run, and improve debugging of multiple received responses during test run. #24573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down