Skip to content

Commit

Permalink
Adjust tests for timing differences on Node 14.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Aug 5, 2020
1 parent 7d0d7b2 commit 0b6bbb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions test/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ describe('Object', function() {
buf = null;
gc();
setImmediate(() => {
assert(buf_gc, '"buf" has not been garbage collected');
gc();
setImmediate(() => {
assert(o_gc, '"o" has not been garbage collected');
done();
assert(buf_gc, '"buf" has not been garbage collected');
gc();
setImmediate(() => {
setImmediate(() => {
assert(o_gc, '"o" has not been garbage collected');
done();
});
});
});
});
});
Expand Down
6 changes: 4 additions & 2 deletions test/pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ describe('pointer', function() {
assert(parent_gc, '"parent" has not been garbage collected');
gc();
setImmediate(() => {
assert(child_gc, '"child" has not been garbage collected');
done();
setImmediate(() => {
assert(child_gc, '"child" has not been garbage collected');
done();
});
});
});
});
Expand Down

0 comments on commit 0b6bbb3

Please sign in to comment.