Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update test-timers-block-eventloop.js #16314

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions test/sequential/test-timers-block-eventloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

const common = require('../common');
const fs = require('fs');
const commonTimeout = common.platformTimeout;

const t1 = setInterval(() => {
common.busyLoop(12);
}, 10);
common.busyLoop(commonTimeout(12));
Copy link
Member

@lpinca lpinca Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should use common.platformTimeout() here. I think we don't want to increase the duration of the "busy" loop.

Edit: nvm this is probably correct or we will test something different from the original.

}, common.platformTimeout(10));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, maybe use commonTimeout() here too.


const t2 = setInterval(() => {
common.busyLoop(15);
}, 10);
common.busyLoop(commonTimeout(15));
}, commonTimeout(10));

const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), 100);
const t3 =
setTimeout(common.mustNotCall('eventloop blocked!'), commonTimeout(200));

setTimeout(function() {
fs.stat('./nonexistent.txt', (err, stats) => {
fs.stat('/dev/nonexistent', (err, stats) => {
clearInterval(t1);
clearInterval(t2);
clearTimeout(t3);
});
}, 50);
}, commonTimeout(50));