Skip to content

Commit f0f5e4f

Browse files
committed
test: fix watch mode test flake
PR-URL: #44739 Backport-PR-URL: #44815Fixes: #44735 Reviewed-By: Erick Wendel <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent fb319fe commit f0f5e4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎test/sequential/test-watch-mode.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ describe('watch mode',{concurrency: true, timeout: 60_0000 }, () =>{
9494
constfile=fixtures.path('watch-mode/failing.js');
9595
const{ stderr, stdout }=awaitspawnWithRestarts({ file });
9696

97+
// Use match first to pretty print diff on failure
9798
assert.match(stderr,/Error:fails\r?\n/);
98-
assert.strictEqual(stderr.match(/Error:fails\r?\n/g).length,2);
99+
// Test that failures happen once per restart
100+
assert(stderr.match(/Error:fails\r?\n/g).length>=2);
99101
assertRestartedCorrectly({
100102
stdout,
101103
messages: {completed: `Failed running ${inspect(file)}`,restarted: `Restarting ${inspect(file)}`},

0 commit comments

Comments
(0)