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
squash! nit fix
  • Loading branch information
Trott committed May 14, 2018
commit 34160c7777b9df9731985734d6938abeb31215f0
2 changes: 1 addition & 1 deletion test/sequential/test-http2-session-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server.listen(0, common.mustCall(() => {
const diff = process.hrtime(startTime);
Copy link
Copy Markdown
Contributor

@apapirovski apapirovski May 13, 2018

Choose a reason for hiding this comment

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

I'm -1 on this change. process.hrtime isn't cheap so it's more — not less — likely to create situations where this test fails on slow platforms.

Actually, scratch that, I see what's making this more reliable.

const milliseconds = (diff[0] * 1e3 + diff[1] / 1e6);
if (milliseconds < serverTimeout * 2) {
setTimeout(() => makeReq(), callTimeout);
setTimeout(makeReq, callTimeout);
} else {
server.removeListener('timeout', mustNotCall);
server.close();
Expand Down