Skip to content

Commit 3492d2d

Browse files
Trottrvagg
authored andcommitted
test: make test-process-argv-0 robust
Remove use of STDERR to avoid test flakiness on CentOS 5. Use parent process exit event for assertion rather than child exit event. PR-URL: #2541 Fixes: #2477 Reviewed-By: Michaël Zasso <[email protected]>
1 parent 13fd96d commit 3492d2d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

test/parallel/test-process-argv-0.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
11
'use strict';
2-
var util = require('util');
32
var path = require('path');
43
var assert = require('assert');
54
var spawn = require('child_process').spawn;
6-
var common = require('../common');
7-
8-
console.error('argv=%j', process.argv);
9-
console.error('exec=%j', process.execPath);
105

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

1611
var childArgv0 = '';
17-
var childErr = '';
1812
child.stdout.on('data', function(chunk) {
1913
childArgv0 += chunk;
2014
});
21-
child.stderr.on('data', function(chunk) {
22-
childErr += chunk;
23-
});
24-
child.on('exit', function() {
25-
console.error('CHILD: %s', childErr.trim().split('\n').join('\nCHILD: '));
15+
process.on('exit', function() {
2616
assert.equal(childArgv0, process.execPath);
2717
});
2818
}

0 commit comments

Comments
 (0)