From 856baf4c67015c612167aa016046667ab9d18677 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 24 Aug 2015 21:25:48 -0700 Subject: [PATCH] test: make spawnSync() test robust The test had checked that a timer fired within a period after spawnSync() returns. The result was a test that sometimes was flaky. Because there's no guarantee of how long a timer will take before running, remove the check. There is a check that the timer runs after spawnSync() so that is sufficient. PR-URL: https://github.com/nodejs/node/pull/2535 Fixes: https://github.com/nodejs/node/issues/2470 Reviewed-By: Ben Noordhuis --- test/parallel/test-child-process-spawnsync.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/parallel/test-child-process-spawnsync.js b/test/parallel/test-child-process-spawnsync.js index 619cfb7a9d5f76..d66c51c9c41b2f 100644 --- a/test/parallel/test-child-process-spawnsync.js +++ b/test/parallel/test-child-process-spawnsync.js @@ -7,12 +7,8 @@ var spawnSync = require('child_process').spawnSync; var TIMER = 100; var SLEEP = 1000; -var timeout = 0; - setTimeout(function() { - timeout = process.hrtime(start); assert.ok(stop, 'timer should not fire before process exits'); - assert.strictEqual(timeout[0], 1, 'timer should take as long as sleep'); }, TIMER); console.log('sleep started');