Skip to content

Commit

Permalink
test: allow for slow hosts in spawnSync() test
Browse files Browse the repository at this point in the history
test-child-process-spawnsync-timeout failed from time to time on
Raspberry Pi devices. Use common.platformTimeout() to allow a little
more time to run on resource-constrained hosts.

PR-URL: nodejs#10998
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott committed Jan 27, 2017
1 parent c74e6fe commit b6d2fc9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/parallel/test-child-process-spawnsync-timeout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');

const spawnSync = require('child_process').spawnSync;

const TIMER = 200;
const SLEEP = 5000;
const SLEEP = common.platformTimeout(5000);

switch (process.argv[2]) {
case 'child':
Expand All @@ -19,7 +19,6 @@ switch (process.argv[2]) {
const ret = spawnSync(process.execPath, [__filename, 'child'],
{timeout: TIMER});
assert.strictEqual(ret.error.errno, 'ETIMEDOUT');
console.log(ret);
const end = Date.now() - start;
assert(end < SLEEP);
assert(ret.status > 128 || ret.signal);
Expand Down

0 comments on commit b6d2fc9

Please sign in to comment.