Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: timer_unit
  • Loading branch information
ttzztztz committed Feb 19, 2021
commit 51921f73890790322f58c1b263265c39d10c9c01
5 changes: 3 additions & 2 deletions test/parallel/test-timers-promisified.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,11 @@ process.on('multipleResolves', common.mustNotCall());
let pre = false;
let post = false;

const time_unit = common.platformTimeout(50);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Optional nit: Since the problem we've been seeing is with the test being flaky on a fast machine, I wonder if common.platformTimeout() isn't needed here. It's usually for giving slow machines more time, but the problem we're seeing right now is the other way around--our LinuxONE host is too efficient.

Promise.all([
setPromiseTimeout(1).then(() => pre = true),
new Promise((res) => {
const iterable = timerPromises.setInterval(200);
const iterable = timerPromises.setInterval(time_unit * 2);
const iterator = iterable[Symbol.asyncIterator]();

iterator.next().then(() => {
Expand All @@ -408,6 +409,6 @@ process.on('multipleResolves', common.mustNotCall());
return iterator.return();
}).then(res);
}),
setPromiseTimeout(300).then(() => post = true)
setPromiseTimeout(time_unit * 3).then(() => post = true)
]).then(common.mustCall());
}