Skip to content

Commit

Permalink
test: check gc does not resurrect the loop
Browse files Browse the repository at this point in the history
PR-URL: #21093
Fixes: #18190
Refs: #18307
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
apapirovski authored and targos committed Jun 13, 2018
1 parent 4f01168 commit bda34ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/sequential/test-async-wrap-getasyncid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
// Flags: --expose-gc

const common = require('../common');
const assert = require('assert');
Expand All @@ -22,6 +23,11 @@ common.crashOnUnhandledRejection();
},
}).enable();
process.on('beforeExit', common.mustCall(() => {
// This garbage collection call verifies that the wraps being garbage
// collected doesn't resurrect the process again due to weirdly timed
// uv_close calls and other similar instruments in destructors.
global.gc();

process.removeAllListeners('uncaughtException');
hooks.disable();
delete providers.NONE; // Should never be used.
Expand Down

0 comments on commit bda34ea

Please sign in to comment.