Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test-force-repl #14439

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}));