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-with-eval #9460

Merged
merged 1 commit into from
Nov 6, 2016
Merged
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
6 changes: 1 addition & 5 deletions test/parallel/test-force-repl-with-eval.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
'use strict';
const common = require('../common');
require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

// spawn a node child process in "interactive" mode (force the repl) and eval
const cp = spawn(process.execPath, ['-i', '-e', 'console.log("42")']);
var gotToEnd = false;
const timeoutId = setTimeout(function() {
throw new Error('timeout!');
}, common.platformTimeout(1000)); // give node + the repl 1 second to boot up

cp.stdout.setEncoding('utf8');

var output = '';
cp.stdout.on('data', function(b) {
output += b;
if (output === '> 42\n') {
clearTimeout(timeoutId);
gotToEnd = true;
cp.kill();
}
Expand Down