From dc24127e5c67ae7d5e113886d27b00a42f6d8d3c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 25 Jan 2017 09:15:25 -0800 Subject: [PATCH] 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 Reviewed-By: Santiago Gimeno Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- test/parallel/test-child-process-spawnsync-timeout.js | 11 +++++------ 1 file 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 122a65825949df..c804f7502755bb 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;