◐ Shell
clean mode source ↗

test: check gc does not resurrect the loop · nodejs/node@bda34ea

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

'use strict';

2+

// Flags: --expose-gc

23
34

const common = require('../common');

45

const assert = require('assert');

@@ -22,6 +23,11 @@ common.crashOnUnhandledRejection();

2223

},

2324

}).enable();

2425

process.on('beforeExit', common.mustCall(() => {

26+

// This garbage collection call verifies that the wraps being garbage

27+

// collected doesn't resurrect the process again due to weirdly timed

28+

// uv_close calls and other similar instruments in destructors.

29+

global.gc();

30+
2531

process.removeAllListeners('uncaughtException');

2632

hooks.disable();

2733

delete providers.NONE; // Should never be used.