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
  • Loading branch information
santigimeno committed Feb 10, 2018
1 parent b8f47b2 commit e701d33
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 e701d33

Please sign in to comment.