Skip to content

Commit

Permalink
test: fix flaky repl-timeout-throw
Browse files Browse the repository at this point in the history
Don't disconnect the child until all exceptions are thrown.

Fixes: #18659

PR-URL: #18692
Fixes: #18659
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
santigimeno authored and rvagg committed Aug 16, 2018
1 parent 3cdae15 commit 4eca50a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sequential/test-repl-timeout-throw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');

const spawn = require('child_process').spawn;
Expand All @@ -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) {
Expand Down Expand Up @@ -46,8 +48,6 @@ child.stdout.once('data', function() {
' });\n' +
' });\n' +
'});"";\n');

setTimeout(child.stdin.end.bind(child.stdin), common.platformTimeout(200));
}
});

Expand Down

0 comments on commit 4eca50a

Please sign in to comment.