mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 18:02:21 +00:00

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: https://github.com/nodejs/node/pull/2541 Fixes: https://github.com/nodejs/node/issues/2477 Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
22 lines
502 B
JavaScript
22 lines
502 B
JavaScript
'use strict';
|
|
var path = require('path');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
if (process.argv[2] !== 'child') {
|
|
var child = spawn(process.execPath, [__filename, 'child'], {
|
|
cwd: path.dirname(process.execPath)
|
|
});
|
|
|
|
var childArgv0 = '';
|
|
child.stdout.on('data', function(chunk) {
|
|
childArgv0 += chunk;
|
|
});
|
|
process.on('exit', function() {
|
|
assert.equal(childArgv0, process.execPath);
|
|
});
|
|
}
|
|
else {
|
|
process.stdout.write(process.argv[0]);
|
|
}
|