Skip to content

Commit fce364a

Browse files
authored
Fix skipping reftests and add helper to skip ref tests. (#24798)
Reftests that were being skipped were still trying to run the reftest snapshot code and report a result. Since this was async, the result would sometimes come in while the next test was started and cause "excessive responses from previous test". This should fix flakes with several test_webgl tests.
1 parent e3b26f9 commit fce364a

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

test/browser/webgl_draw_base_vertex_base_instance_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int main() {
7070

7171
if (!extAvailable) {
7272
EM_ASM({
73-
fetch('http://localhost:8888/report_result?skipped:%20WEBGL_draw_instanced_base_vertex_base_instance%20is%20not%20supported!').then(() => window.close());
73+
skipTest('WEBGL_draw_instanced_base_vertex_base_instance is not supported');
7474
});
7575
return 0;
7676
}

test/browser/webgl_multi_draw_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main()
6060

6161
if (!extAvailable) {
6262
EM_ASM({
63-
fetch("http://localhost:8888/report_result?skipped:%20WEBGL_multi_draw%20is%20not%20supported!").then(() => window.close());
63+
skipTest('WEBGL_multi_draw is not supported');
6464
});
6565
return 0;
6666
}

test/browser_reporting.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ function reportStdoutToServer(message) {
5252
}
5353
}
5454

55+
async function skipTest(message) {
56+
await reportResultToServer(`skipped:${message}`);
57+
}
58+
5559
function reportTopLevelError(e) {
5660
// MINIMAL_RUNTIME doesn't handle exit or call the below onExit handler
5761
// so we detect the exit by parsing the uncaught exception message.

test/canvas_animate_resize.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ int main()
126126
if (!ctx) {
127127
if (!emscripten_supports_offscreencanvas()) {
128128
EM_ASM({
129-
fetch("http://localhost:8888/report_result?skipped:%20OffscreenCanvas%20is%20not%20supported!")
130-
.then(() => window.close());
129+
skipTest('OffscreenCanvas is not supported!');
131130
});
132131
}
133132
return 0;

test/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2413,11 +2413,11 @@ def run_browser(self, html_file, expected=None, message=None, timeout=None, extr
24132413
# the browser harness reported an error already, and sent a None to tell
24142414
# us to also fail the test
24152415
self.fail('browser harness error')
2416+
output = unquote(output)
24162417
if output.startswith('/report_result?skipped:'):
24172418
self.skipTest(unquote(output[len('/report_result?skipped:'):]).strip())
24182419
else:
24192420
# verify the result, and try again if we should do so
2420-
output = unquote(output)
24212421
try:
24222422
self.assertContained(expected, output)
24232423
except self.failureException as e:

test/reftest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function reftestUnblock() {
2323
function doReftest() {
2424
if (reftestBlocked) return;
2525
if (doReftest.done) return;
26+
if (reportResultToServer.reported) return;
2627
doReftest.done = true;
2728
var img = new Image();
2829
img.onload = () => {

0 commit comments

Comments
 (0)