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>
This commit is contained in:
parent
5886e204f0
commit
83b8474e64
@ -2,21 +2,23 @@
|
|||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const platformTimeout = common.platformTimeout;
|
||||||
|
|
||||||
const t1 = setInterval(() => {
|
const t1 = setInterval(() => {
|
||||||
common.busyLoop(12);
|
common.busyLoop(platformTimeout(12));
|
||||||
}, 10);
|
}, platformTimeout(10));
|
||||||
|
|
||||||
const t2 = setInterval(() => {
|
const t2 = setInterval(() => {
|
||||||
common.busyLoop(15);
|
common.busyLoop(platformTimeout(15));
|
||||||
}, 10);
|
}, platformTimeout(10));
|
||||||
|
|
||||||
const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100);
|
const t3 =
|
||||||
|
setTimeout(common.mustNotCall('eventloop blocked!'), platformTimeout(200));
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
fs.stat('./nonexistent.txt', (err, stats) => {
|
fs.stat('/dev/nonexistent', (err, stats) => {
|
||||||
clearInterval(t1);
|
clearInterval(t1);
|
||||||
clearInterval(t2);
|
clearInterval(t2);
|
||||||
clearTimeout(t3);
|
clearTimeout(t3);
|
||||||
});
|
});
|
||||||
}, 50);
|
}, platformTimeout(50));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user