Browse Source

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>
v7.x
Santiago Gimeno 8 years ago
committed by Evan Lucas
parent
commit
f640bafc58
  1. 6
      test/parallel/test-force-repl-with-eval.js

6
test/parallel/test-force-repl-with-eval.js

@ -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();
}

Loading…
Cancel
Save