Skip to content

Commit d6c6c57

Browse files
authored
Fix Firefox browser test run, and improve debugging of multiple received responses during test run. (#24573)
1 parent 1161ea6 commit d6c6c57

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,9 @@ def log_request(code=0, size=0):
22362236

22372237
# allows streaming compilation to work
22382238
SimpleHTTPRequestHandler.extensions_map['.wasm'] = 'application/wasm'
2239+
# Firefox browser security does not allow loading .mjs files if they
2240+
# do not have the correct MIME type
2241+
SimpleHTTPRequestHandler.extensions_map['.mjs'] = 'text/javascript'
22392242

22402243
httpd = HTTPServer(('localhost', port), TestServerHandler)
22412244
httpd.serve_forever() # test runner will kill us
@@ -2323,9 +2326,10 @@ def is_browser_test(self):
23232326

23242327
def assert_out_queue_empty(self, who):
23252328
if not self.harness_out_queue.empty():
2329+
responses = []
23262330
while not self.harness_out_queue.empty():
2327-
self.harness_out_queue.get()
2328-
raise Exception('excessive responses from %s' % who)
2331+
responses += [self.harness_out_queue.get()]
2332+
raise Exception('excessive responses from %s: %s' % (who, '\n'.join(responses)))
23292333

23302334
# @param extra_tries: how many more times to try this test, if it fails. browser tests have
23312335
# many more causes of flakiness (in particular, they do not run

0 commit comments

Comments
 (0)