mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/59910 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
22 lines
402 B
JavaScript
22 lines
402 B
JavaScript
// Flags: --expose-gc
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { channel } = require('diagnostics_channel');
|
|
|
|
function test() {
|
|
function subscribe() {
|
|
channel('test-gc').subscribe(function noop() {});
|
|
}
|
|
|
|
subscribe();
|
|
|
|
setTimeout(() => {
|
|
global.gc();
|
|
assert.ok(channel('test-gc').hasSubscribers, 'Channel must have subscribers');
|
|
});
|
|
}
|
|
|
|
test();
|