Skip to content

Commit bcb6c4a

Browse files
committed
test: skip test-diagnostics-channel-memory-leak.js
There is currently no reliable way to detect this leak because: 1. We cannot reliably get a reference to the channel from the API to detect finalization without creating another strong reference. 2. This test does gc() and then checks memory usage - however the use of gc() disables code aging which can actually lead to increased memory usage overall, as it is not intended to be used to lower memory usage in the first place. 3. The implementation of diagnostics channels relies on ephemeron gc which is inefficient, it's not reliable to use the typical "create a lot of objects and see if it crashes" trick to check leaks. Skip the test for now until we find a way to test it reliably. To avoid flakiness in the CI, it's better to remove an unreliable test altogether.
1 parent 9c714d8 commit bcb6c4a

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

test/fixtures/promise-resolve.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Promise.reject('test').catch(() => Promise.resolve('test'));

test/parallel/parallel.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ 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
811

912
[$system==win32]
1013
# https://github.com/nodejs/node/issues/41206

test/parallel/test-trace-promises.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
require('../common');
4+
const fixtures = require('../common/fixtures');
5+
const assert = require('assert');
6+
const {
7+
spawnSyncAndExitWithoutError,
8+
} = require('../common/child_process');
9+
10+
spawnSyncAndExitWithoutError(process.execPath, [
11+
'--trace-promises',
12+
fixtures.path('promise-resolve')
13+
], {
14+
stderr(output) {
15+
const creation = output.match(/\[--trace-promises\] created promise #\d+/);
16+
const resolution = output.match(/\[--trace-promises\] resolved promise #\d+/);
17+
const location = output.match(/\[--trace-promises\] resolved promise #\d+/);
18+
console.log(output);
19+
return false;
20+
}
21+
});
22+

0 commit comments

Comments
 (0)