From 08115b7d91b0340e3f04e2fb6b800ce72b387a38 Mon Sep 17 00:00:00 2001 From: Seonghoi Lee Date: Thu, 20 Feb 2025 16:09:51 +0900 Subject: [PATCH] Try to resolve some flaky tests test list - browser64.test_offset_converter - wasm64.test_pthread_wait64_notify 1. Sometimes test_offset_converter give unresponsiveness and the possibility for it is the error from JS section 2. TimeoutNegativeWarning emerges node >= 23 and wasm64 requires node >= 24. `emscripten_set_timeout_loop` may throw warning. Node serves [`--disable-warning` option on 21.3.0](https://nodejs.org/en/blog/release/v21.3.0) fortunately. --- test/browser/test_offset_converter.c | 13 +++++++++---- test/common.py | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/test/browser/test_offset_converter.c b/test/browser/test_offset_converter.c index 06fe565d2ee8b..3ac12aad0d2bf 100644 --- a/test/browser/test_offset_converter.c +++ b/test/browser/test_offset_converter.c @@ -12,10 +12,15 @@ void magic_test_function(void) { out(x); fetch('http://localhost:8888?stdout=' + encodeURIComponent(x)); } - report('magic_test_function: input=' + $0); - var converted = wasmOffsetConverter.getName($0); - report('magic_test_function: converted=' + converted); - return converted == 'magic_test_function'; + try { + report('magic_test_function: input=' + $0); + var converted = wasmOffsetConverter.getName($0); + report('magic_test_function: converted=' + converted); + return converted == 'magic_test_function'; + } catch (e) { + report((e?.message ?? '(unknown message)') + ' ' + (e?.stack ?? '(unknown stack)')); + return false; + } }, get_pc()); assert(result); } diff --git a/test/common.py b/test/common.py index 9aabd3229b9ec..051d4d040c2fc 100644 --- a/test/common.py +++ b/test/common.py @@ -1201,6 +1201,12 @@ def setUp(self): # Opt in to node v15 default behaviour: # https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode self.node_args.append('--unhandled-rejections=throw') + elif node_version >= (23, 0, 0): + # node version >= 23 warns negative timer value, which + # emscripten_set_timeout_loop() sometimes met it. + # TimeoutNegativeWarning is introduced with + # https://github.com/nodejs/node/pull/46678 + self.node_args.append('--disable-warning=TimeoutNegativeWarning') # If the version we are running tests in is lower than the version that # emcc targets then we need to tell emcc to target that older version.