From e701d33a2a32abdd130b460a8313d5293e809b57 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sat, 10 Feb 2018 09:32:49 +0100 Subject: [PATCH] test: fix flaky repl-timeout-throw Don't disconnect the child until all exceptions are thrown. Fixes: https://github.com/nodejs/node/issues/18659 --- test/sequential/test-repl-timeout-throw.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index aa933394b42ae7..3636b93ddfc2b2 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -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)); } });