diff options
author | Rich Trott <rtrott@gmail.com> | 2017-01-25 20:15:25 +0300 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2017-03-09 04:11:20 +0300 |
commit | 8ff15a262d7d56112f9bd07d12af14cdaeaf9182 (patch) | |
tree | 06276850ea4ddba6febe29edf30944ba252205de | |
parent | 4d6fa8d0406966de2071b2cfb209f821f0a2f5d4 (diff) |
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: https://github.com/nodejs/node/pull/10998
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
-rw-r--r-- | test/parallel/test-child-process-spawnsync-timeout.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/parallel/test-child-process-spawnsync-timeout.js b/test/parallel/test-child-process-spawnsync-timeout.js index 122a6582594..c804f750275 100644 --- a/test/parallel/test-child-process-spawnsync-timeout.js +++ b/test/parallel/test-child-process-spawnsync-timeout.js @@ -1,11 +1,11 @@ 'use strict'; -require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); var spawnSync = require('child_process').spawnSync; -var TIMER = 200; -var SLEEP = 5000; +const TIMER = 200; +const SLEEP = common.platformTimeout(5000); switch (process.argv[2]) { case 'child': @@ -19,8 +19,7 @@ switch (process.argv[2]) { var ret = spawnSync(process.execPath, [__filename, 'child'], {timeout: TIMER}); assert.strictEqual(ret.error.errno, 'ETIMEDOUT'); - console.log(ret); - var end = Date.now() - start; + const end = Date.now() - start; assert(end < SLEEP); assert(ret.status > 128 || ret.signal); break; |