Skip to content

Commit dc24127

Browse files
TrottMylesBorins
authored andcommitted
test: allow for slow hosts in spawnSync() test
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: #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]>
1 parent 14e57c1 commit dc24127

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/parallel/test-child-process-spawnsync-timeout.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
2-
require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

55
var spawnSync = require('child_process').spawnSync;
66

7-
var TIMER = 200;
8-
var SLEEP = 5000;
7+
const TIMER = 200;
8+
const SLEEP = common.platformTimeout(5000);
99

1010
switch (process.argv[2]) {
1111
case 'child':
@@ -19,8 +19,7 @@ switch (process.argv[2]) {
1919
var ret = spawnSync(process.execPath, [__filename, 'child'],
2020
{timeout: TIMER});
2121
assert.strictEqual(ret.error.errno, 'ETIMEDOUT');
22-
console.log(ret);
23-
var end = Date.now() - start;
22+
const end = Date.now() - start;
2423
assert(end < SLEEP);
2524
assert(ret.status > 128 || ret.signal);
2625
break;

0 commit comments

Comments
 (0)