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 0510f42

Browse filesBrowse files
zhangzifagibfahn
authored andcommitted
test: update test-timers-block-eventloop.js
When CPU is busy, the above sequential case fails occasionally, expand the timeout value to fix it. PR-URL: #16314 Fixes: #16310 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent 6ac7eef commit 0510f42
Copy full SHA for 0510f42

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+9
-7
lines changed
Open diff view settings
Collapse file

‎test/sequential/test-timers-block-eventloop.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-timers-block-eventloop.js
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22

33
const common = require('../common');
44
const fs = require('fs');
5+
const platformTimeout = common.platformTimeout;
56

67
const t1 = setInterval(() => {
7-
common.busyLoop(12);
8-
}, 10);
8+
common.busyLoop(platformTimeout(12));
9+
}, platformTimeout(10));
910

1011
const t2 = setInterval(() => {
11-
common.busyLoop(15);
12-
}, 10);
12+
common.busyLoop(platformTimeout(15));
13+
}, platformTimeout(10));
1314

14-
const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100);
15+
const t3 =
16+
setTimeout(common.mustNotCall('eventloop blocked!'), platformTimeout(200));
1517

1618
setTimeout(function() {
17-
fs.stat('./nonexistent.txt', (err, stats) => {
19+
fs.stat('/dev/nonexistent', (err, stats) => {
1820
clearInterval(t1);
1921
clearInterval(t2);
2022
clearTimeout(t3);
2123
});
22-
}, 50);
24+
}, platformTimeout(50));

0 commit comments

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