From ff16545f609bf7833cd5c6cf10dd3993d1a849f0 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Wed, 6 Jun 2018 16:06:51 -0400 Subject: [PATCH] test: check gc does not resurrect the loop PR-URL: https://github.com/nodejs/node/pull/21093 Fixes: https://github.com/nodejs/node/issues/18190 Refs: https://github.com/nodejs/node/pull/18307 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig --- test/sequential/test-async-wrap-getasyncid.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index c16624a79e6c83..60309ecb2d49b8 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -1,4 +1,5 @@ 'use strict'; +// Flags: --expose-gc const common = require('../common'); const assert = require('assert'); @@ -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.