Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 514e516

Browse filesBrowse files
kvakilruyadorno
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 <admin@stephenbelanger.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 1a44fbc commit 514e516
Copy full SHA for 514e516

File tree

Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-5
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-diagnostics-channel-net.js
+2-5Lines changed: 2 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.