test: fix flaky repl-timeout-throw
Don't disconnect the child until all exceptions are thrown. Fixes: https://github.com/nodejs/node/issues/18659 PR-URL: https://github.com/nodejs/node/pull/18692 Fixes: https://github.com/nodejs/node/issues/18659 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
540cbf84af
commit
01d049165c
@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
const spawn = require('child_process').spawn;
|
||||
@ -13,6 +13,8 @@ child.stdout.setEncoding('utf8');
|
||||
child.stdout.on('data', function(c) {
|
||||
process.stdout.write(c);
|
||||
stdout += c;
|
||||
if (stdout.includes('> THROW 2'))
|
||||
child.stdin.end();
|
||||
});
|
||||
|
||||
child.stdin.write = function(original) {
|
||||
@ -46,8 +48,6 @@ child.stdout.once('data', function() {
|
||||
' });\n' +
|
||||
' });\n' +
|
||||
'});"";\n');
|
||||
|
||||
setTimeout(child.stdin.end.bind(child.stdin), common.platformTimeout(200));
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user