mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
655 B
27 lines
655 B
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
const spawnSync = require('child_process').spawnSync;
|
|
|
|
var TIMER = 200;
|
|
var SLEEP = 5000;
|
|
|
|
switch (process.argv[2]) {
|
|
case 'child':
|
|
setTimeout(function() {
|
|
console.log('child fired');
|
|
process.exit(1);
|
|
}, SLEEP);
|
|
break;
|
|
default:
|
|
var start = Date.now();
|
|
var ret = spawnSync(process.execPath, [__filename, 'child'],
|
|
{timeout: TIMER});
|
|
assert.strictEqual(ret.error.errno, 'ETIMEDOUT');
|
|
console.log(ret);
|
|
var end = Date.now() - start;
|
|
assert(end < SLEEP);
|
|
assert(ret.status > 128 || ret.signal);
|
|
break;
|
|
}
|
|
|