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 556703d

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: fix flaky unrefed timers test
Remove unnecessary `setImmediate()` that causes a minor race condition. Stop the test after 3 occurrences rather than 5 to allow for slower hosts running the test in parallel with other tests. Fixes: #4559 PR-URL: #4599 Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
1 parent 15fa555 commit 556703d
Copy full SHA for 556703d

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-timers-unrefd-interval-still-fires.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-timers-unrefd-interval-still-fires.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const common = require('../common');
66

77
const TEST_DURATION = common.platformTimeout(100);
8-
const N = 5;
8+
const N = 3;
99
var nbIntervalFired = 0;
1010

1111
const keepOpen = setTimeout(() => {
@@ -20,7 +20,7 @@ const timer = setInterval(() => {
2020
timer._onTimeout = () => {
2121
throw new Error('Unrefd interval fired after being cleared.');
2222
};
23-
setImmediate(() => clearTimeout(keepOpen));
23+
clearTimeout(keepOpen);
2424
}
2525
}, 1);
2626

0 commit comments

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