Skip to content

Commit 9b715a9

Browse files
authored
[ci] Enable capture_stdio when retrying browser tests. NFC (#24207)
1 parent 0c45bbd commit 9b715a9

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4241
1+
4239

test/browser_reporting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var captureStdio = false;
33

44
var hasModule = typeof Module === 'object' && Module;
55

6-
var reportingURL = 'http://localhost:8888/';
6+
var reportingURL = 'http://localhost:8888';
77

88
async function reportResultToServer(result) {
99
if (reportResultToServer.reported) {

test/common.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ def do_POST(self):
21282128
self.send_response(200)
21292129
self.end_headers()
21302130
else:
2131-
print(f'do_POST: unexpected POST: {urlinfo.query}')
2131+
print(f'do_POST: unexpected POST: {urlinfo}')
21322132

21332133
def do_GET(self):
21342134
info = urlparse(self.path)
@@ -2317,6 +2317,10 @@ def assert_out_queue_empty(self, who):
23172317
def run_browser(self, html_file, expected=None, message=None, timeout=None, extra_tries=1):
23182318
if not has_browser():
23192319
return
2320+
assert '?' not in html_file, 'URL params not supported'
2321+
url = html_file
2322+
if self.capture_stdio:
2323+
url += '?capture_stdio'
23202324
if self.skip_exec:
23212325
self.skipTest('skipping test execution: ' + self.skip_exec)
23222326
if BrowserCore.unresponsive_tests >= BrowserCore.MAX_UNRESPONSIVE_TESTS:
@@ -2328,7 +2332,7 @@ def run_browser(self, html_file, expected=None, message=None, timeout=None, extr
23282332
if expected is not None:
23292333
try:
23302334
self.harness_in_queue.put((
2331-
'http://localhost:%s/%s' % (self.PORT, html_file),
2335+
'http://localhost:%s/%s' % (self.PORT, url),
23322336
self.get_dir(),
23332337
))
23342338
if timeout is None:
@@ -2357,6 +2361,9 @@ def run_browser(self, html_file, expected=None, message=None, timeout=None, extr
23572361
if extra_tries > 0:
23582362
print('[test error (see below), automatically retrying]')
23592363
print(e)
2364+
if not self.capture_stdio:
2365+
print('[enabling stdio/stderr reporting]')
2366+
self.capture_stdio = True
23602367
return self.run_browser(html_file, expected, message, timeout, extra_tries - 1)
23612368
else:
23622369
raise e
@@ -2433,10 +2440,7 @@ def btest(self, filename, expected=None,
24332440
output = self.run_js('test.js')
24342441
self.assertContained('RESULT: ' + expected[0], output)
24352442
else:
2436-
url = outfile
2437-
if self.capture_stdio:
2438-
url += "?capture_stdio"
2439-
self.run_browser(url, expected=['/report_result?' + e for e in expected], timeout=timeout, extra_tries=extra_tries)
2443+
self.run_browser(outfile, expected=['/report_result?' + e for e in expected], timeout=timeout, extra_tries=extra_tries)
24402444

24412445

24422446
###################################################################################################

0 commit comments

Comments
 (0)