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.
  • Loading branch information
Trott committed Jul 26, 2017
1 parent f7f590c commit 6b164e9
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 6b164e9

Please sign in to comment.