Skip to content

Commit

Permalink
test: make test-process-argv-0 robust
Browse files Browse the repository at this point in the history
Remove use of STDERR to avoid test flakiness on CentOS.

Fixes: nodejs#2477
  • Loading branch information
Trott committed Aug 25, 2015
1 parent 7e63eb7 commit ae77774
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions test/parallel/test-process-argv-0.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
'use strict';
var util = require('util');
var path = require('path');
var assert = require('assert');
var spawn = require('child_process').spawn;
var common = require('../common');

console.error('argv=%j', process.argv);
console.error('exec=%j', process.execPath);

if (process.argv[2] !== 'child') {
var child = spawn(process.execPath, [__filename, 'child'], {
cwd: path.dirname(process.execPath)
});

var childArgv0 = '';
var childErr = '';
child.stdout.on('data', function(chunk) {
childArgv0 += chunk;
});
child.stderr.on('data', function(chunk) {
childErr += chunk;
});
child.on('exit', function() {
console.error('CHILD: %s', childErr.trim().split('\n').join('\nCHILD: '));
assert.equal(childArgv0, process.execPath);
});
}
Expand Down

0 comments on commit ae77774

Please sign in to comment.