GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: deflake test-diagnostics-channel-memory-leak · nodejs/node@ed07075

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • parallel.status
    • test-diagnostics-channel-memory-leak.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/parallel.status‎

Copy file name to clipboardExpand all lines: test/parallel/parallel.status
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ prefix parallel
55
# sample-test : PASS,FLAKY
66

77
[true] # This section applies to all platforms
8-
# https://github.com/nodejs/node/pull/50327
9-
# Currently there's no reliable way to test it.
10-
test-diagnostics-channel-memory-leak: SKIP
118

129
[$system==win32]
1310
# https://github.com/nodejs/node/issues/41206
Collapse file

‎test/parallel/test-diagnostics-channel-memory-leak.js‎

Copy file name to clipboard
+14-16Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
// Flags: --expose-gc
1+
// Flags: --expose-internals --max-old-space-size=16
22
'use strict';
33

44
// This test ensures that diagnostic channel references aren't leaked.
55

6-
require('../common');
7-
const { ok } = require('assert');
6+
const common = require('../common');
87

9-
const { subscribe, unsubscribe } = require('diagnostics_channel');
8+
const { subscribe, unsubscribe, Channel } = require('diagnostics_channel');
9+
const { checkIfCollectableByCounting } = require('../common/gc');
1010

1111
function noop() {}
1212

13-
const heapUsedBefore = process.memoryUsage().heapUsed;
14-
15-
for (let i = 0; i < 1000; i++) {
16-
subscribe(String(i), noop);
17-
unsubscribe(String(i), noop);
18-
}
19-
20-
global.gc();
21-
22-
const heapUsedAfter = process.memoryUsage().heapUsed;
23-
24-
ok(heapUsedBefore >= heapUsedAfter);
13+
const outer = 64;
14+
const inner = 256;
15+
checkIfCollectableByCounting((i) => {
16+
for (let j = 0; j < inner; j++) {
17+
const key = String(i * inner + j);
18+
subscribe(key, noop);
19+
unsubscribe(key, noop);
20+
}
21+
return inner;
22+
}, Channel, outer).then(common.mustCall());

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.