Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 856baf4

Browse filesBrowse files
Trottrvagg
authored andcommitted
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: #2535 Fixes: #2470 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent f2f0fe4 commit 856baf4
Copy full SHA for 856baf4

File tree

Expand file treeCollapse file tree

1 file changed

+0
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-4
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-spawnsync.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ var spawnSync = require('child_process').spawnSync;
77
var TIMER = 100;
88
var SLEEP = 1000;
99

10-
var timeout = 0;
11-
1210
setTimeout(function() {
13-
timeout = process.hrtime(start);
1411
assert.ok(stop, 'timer should not fire before process exits');
15-
assert.strictEqual(timeout[0], 1, 'timer should take as long as sleep');
1612
}, TIMER);
1713

1814
console.log('sleep started');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.