Skip to content

Commit 03b8cb8

Browse files
kvakiljuanarbol
authored andcommitted
test: deflake test-diagnostics-channel-net
This test uses the deprecated methods in `diagnostic_channel` (see the reference), which are deprecated because the channels can be GC'd while in use, leading to lost messages. Change to use the non-deprecated APIs, which should work. I wasn't able to reproduce this locally; I assume it's memory dependent. Refs: #42714 Fixes: #44143 PR-URL: #44144 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 9dad4b0 commit 03b8cb8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/parallel/test-diagnostics-channel-net.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ const assert = require('assert');
44
const net = require('net');
55
const dc = require('diagnostics_channel');
66

7-
const netClientSocketChannel = dc.channel('net.client.socket');
8-
const netServerSocketChannel = dc.channel('net.server.socket');
9-
107
const isNetSocket = (socket) => socket instanceof net.Socket;
118

12-
netClientSocketChannel.subscribe(common.mustCall(({ socket }) => {
9+
dc.subscribe('net.client.socket', common.mustCall(({ socket }) => {
1310
assert.strictEqual(isNetSocket(socket), true);
1411
}));
1512

16-
netServerSocketChannel.subscribe(common.mustCall(({ socket }) => {
13+
dc.subscribe('net.server.socket', common.mustCall(({ socket }) => {
1714
assert.strictEqual(isNetSocket(socket), true);
1815
}));
1916

0 commit comments

Comments
 (0)