mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user