Skip to content

Commit

Permalink
test: fix flaky test-force-repl-with-eval
Browse files Browse the repository at this point in the history
Remove the timer just in case the test takes longer to complete.

PR-URL: #9460
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
santigimeno authored and evanlucas committed Nov 7, 2016
1 parent 4c4132e commit f640baf
Showing 1 changed file with 1 addition and 5 deletions.
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

0 comments on commit f640baf

Please sign in to comment.