Skip to content

Commit 72d7159

Browse files
santigimenoMylesBorins
authored andcommitted
test: fix flaky repl-timeout-throw
Don't disconnect the child until all exceptions are thrown. Fixes: #18659 PR-URL: #18692 Fixes: #18659 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 3cfb313 commit 72d7159

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/sequential/test-repl-timeout-throw.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const common = require('../common');
2+
require('../common');
33
const assert = require('assert');
44

55
const spawn = require('child_process').spawn;
@@ -13,6 +13,8 @@ child.stdout.setEncoding('utf8');
1313
child.stdout.on('data', function(c) {
1414
process.stdout.write(c);
1515
stdout += c;
16+
if (stdout.includes('> THROW 2'))
17+
child.stdin.end();
1618
});
1719

1820
child.stdin.write = function(original) {
@@ -46,8 +48,6 @@ child.stdout.once('data', function() {
4648
' });\n' +
4749
' });\n' +
4850
'});"";\n');
49-
50-
setTimeout(child.stdin.end.bind(child.stdin), common.platformTimeout(200));
5151
}
5252
});
5353

0 commit comments

Comments
 (0)