summaryrefslogtreecommitdiff
path: root/test/sequential/test-timers-block-eventloop.js
diff options
context:
space:
mode:
authorzhangzifa <tonyzzf@163.com>2017-10-19 17:06:34 +0800
committerMyles Borins <mylesborins@google.com>2017-11-28 13:10:53 +0900
commit84741fdc8145b4ae1616a312c6bbb7c4c5742d6d (patch)
tree0f1b100ae245c8ae61c7e5dab5eb6dc66c56dcb8 /test/sequential/test-timers-block-eventloop.js
parent7c69ca58e0e8424446a8236e4f67e7c9b66710db (diff)
downloadnode-new-84741fdc8145b4ae1616a312c6bbb7c4c5742d6d.tar.gz
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: https://github.com/nodejs/node/pull/16314 Fixes: https://github.com/nodejs/node/issues/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>
Diffstat (limited to 'test/sequential/test-timers-block-eventloop.js')
-rw-r--r--test/sequential/test-timers-block-eventloop.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/sequential/test-timers-block-eventloop.js b/test/sequential/test-timers-block-eventloop.js
index 210cf0d80a..78ecc9e317 100644
--- a/test/sequential/test-timers-block-eventloop.js
+++ b/test/sequential/test-timers-block-eventloop.js
@@ -2,21 +2,23 @@
const common = require('../common');
const fs = require('fs');
+const platformTimeout = common.platformTimeout;
const t1 = setInterval(() => {
- common.busyLoop(12);
-}, 10);
+ common.busyLoop(platformTimeout(12));
+}, platformTimeout(10));
const t2 = setInterval(() => {
- common.busyLoop(15);
-}, 10);
+ common.busyLoop(platformTimeout(15));
+}, platformTimeout(10));
-const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100);
+const t3 =
+ setTimeout(common.mustNotCall('eventloop blocked!'), platformTimeout(200));
setTimeout(function() {
- fs.stat('./nonexistent.txt', (err, stats) => {
+ fs.stat('/dev/nonexistent', (err, stats) => {
clearInterval(t1);
clearInterval(t2);
clearTimeout(t3);
});
-}, 50);
+}, platformTimeout(50));