From c48847c39c9daa5d04d2587b79867431fa3ba3fb Mon Sep 17 00:00:00 2001 From: Christian Aurich Date: Fri, 28 Aug 2026 07:00:21 -0300 Subject: [PATCH] test: deflake test-watch-mode-restart-esm-loading-error The previous deflake of this test, #63390, gave the two restart waits common.platformTimeout(10_000) and left the first restart() on the helper's 1000 ms default. That first call is the one still timing out on CI. It is also the call that needs the budget most. --watch spawns a child process to run the script, so reaching the first Completed running costs two process startups, while the later restarts pay for one. Wrapping the default in platformTimeout() would not have been enough on its own: none of its multipliers reaches a factor of ten, so the budget would still be 1000 ms on these jobs, or 2000 ms in a debug build. Give that call the budget the other two already ask for, stated once in the default rather than three times. The timer bounds how long the test waits for watch mode to make progress, it is not an assertion about restart latency, and the assertions on stdout and stderr are untouched. The same helper is duplicated in test-watch-mode.mjs, with the same default and nine call sites that take it. That file has carried PASS, FLAKY since #44898, which is why only this one surfaces in the reliability reports. Signed-off-by: Christian Aurich --- .../test-watch-mode-restart-esm-loading-error.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sequential/test-watch-mode-restart-esm-loading-error.mjs b/test/sequential/test-watch-mode-restart-esm-loading-error.mjs index 1d1b954588c5..73299a73bfc4 100644 --- a/test/sequential/test-watch-mode-restart-esm-loading-error.mjs +++ b/test/sequential/test-watch-mode-restart-esm-loading-error.mjs @@ -74,7 +74,7 @@ function runInBackground({ args = [], options = {}, completed = 'Completed runni future.resolve(); return { stdout, stderr }; }, - restart(timeout = 1000) { + restart(timeout = common.platformTimeout(10_000)) { if (!child) { run(); } @@ -113,7 +113,7 @@ try { // Update file with syntax error const syntaxErrorContent = `console.log('hello, wor`; - const failedRestart = restart(common.platformTimeout(10_000)); + const failedRestart = restart(); writeFileSync(file, syntaxErrorContent); await sleep(common.platformTimeout(1000)); // Wait for the failed restart @@ -125,7 +125,7 @@ try { `Failed running ${inspect(file)}. Waiting for file changes before restarting...`, ]); - const successfulRestart = restart(common.platformTimeout(10_000)); + const successfulRestart = restart(); writeFileSync(file, `console.log('hello again, world');`); await sleep(common.platformTimeout(1000)); const { stderr: stderr3, stdout: stdout3 } = await successfulRestart;