test: fix flaky test-force-repl-with-eval

Remove the timer just in case the test takes longer to complete.

PR-URL: https://github.com/nodejs/node/pull/9460
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Santiago Gimeno
2016-11-04 11:01:26 +01:00
parent 7dd3fb872d
commit 686b334836

View File

@@ -1,14 +1,11 @@
'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');
@@ -16,7 +13,6 @@ var output = '';
cp.stdout.on('data', function(b) {
output += b;
if (output === '> 42\n') {
clearTimeout(timeoutId);
gotToEnd = true;
cp.kill();
}