Skip to content
Closed
Show file tree
Hide file tree
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
[squash] fix linter errors
  • Loading branch information
BridgeAR committed Sep 26, 2017
commit 19c7eb364a3b9669a1d9e6535b30344bb8038511
12 changes: 6 additions & 6 deletions test/parallel/test-promises-gc-before-handled.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const p = new Promise((res, rej) => {
// Manually call GC due to possible memory constraints with attempting to
// trigger it "naturally".
setTimeout(common.mustCall(() => {
gc();
gc();
gc();
global.gc();
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.

This looks really flakey, why 3 times? Why these delays in the setTimeout?

Are we testing that V8 doesn't drop a live reference in GC here?

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.

We have been forced to check gc-based behaviour in setTimeouts in other cases in recent V8 versions. I don’t think anybody of has really gotten to the ground of it so far.

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.

Oh, I see, then a comment would be nice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am not certain how that comment should look like. Do you have a example?

global.gc();
global.gc();
setTimeout(common.mustCall(() => {
gc();
gc();
gc();
global.gc();
global.gc();
global.gc();
setTimeout(common.mustCall(() => {
p.catch(() => {});
}, 1), 250);
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-promises-handled-reject.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const p = new Promise((res, rej) => {
// trigger it "naturally".
setTimeout(common.mustCall(() => {
p.catch(() => {});
gc();
gc();
gc();
global.gc();
global.gc();
global.gc();
}, 1), 2);