Skip to content

Commit

Permalink
test: fix flaky test-force-repl
Browse files Browse the repository at this point in the history
test/parallel/test-force-repl.js has an unnecessary timer that makes the
test flaky under load. Remove it.

PR-URL: #14439
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Aug 16, 2017
1 parent 90da435 commit 2a094c5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/parallel/test-force-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

// spawn a node child process in "interactive" mode (force the repl)
// Spawn a node child process in interactive mode (enabling the REPL) and
// confirm the '> ' prompt is included in the output.
const cp = spawn(process.execPath, ['-i']);
// give node + the repl 5 seconds to start
const timeoutId = setTimeout(common.mustNotCall(),
common.platformTimeout(5000));

cp.stdout.setEncoding('utf8');

cp.stdout.once('data', common.mustCall(function(b) {
clearTimeout(timeoutId);
assert.strictEqual(b, '> ');
cp.kill();
}));

0 comments on commit 2a094c5

Please sign in to comment.