-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
src: write named pipe info in diagnostic report #38637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
534db1a
74b1e3e
5dd9185
477e50f
0efa117
69d3ea5
6451d80
0112fba
14e0b9a
d5d6ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,17 @@ | |
| // Testcase to check reporting of uv handles. | ||
| const common = require('../common'); | ||
| const tmpdir = require('../common/tmpdir'); | ||
| const path = require('path'); | ||
| if (common.isIBMi) | ||
| common.skip('IBMi does not support fs.watch()'); | ||
|
|
||
| function pipeName(windowsExtended) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is only called with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated common.PIPE to use '\\?\' prefix. Most likely there should not be any difference regarding the pipe API. However my local windows VM doesn't behave well and lots of unrelated test cases were falling for unknown reasons. So just pushed the updates and let's see what the CI says. |
||
| const localRelative = path.relative(process.cwd(), `${tmpdir.path}/`); | ||
| const pipePrefix = common.isWindows ? `\\\\${windowsExtended ? '?' : '.'}\\pipe\\` : localRelative; | ||
| const filename = `node-test.${process.pid}.sock`; | ||
| return path.join(pipePrefix, filename); | ||
| } | ||
|
|
||
| function createFsHandle(childData) { | ||
| const fs = require('fs'); | ||
| // Watching files should result in fs_event/fs_poll uv handles. | ||
|
|
@@ -90,7 +98,7 @@ function createUdpHandle(childData) { | |
|
|
||
| function createNamedPipeHandle(childData) { | ||
| const net = require('net'); | ||
| const sockPath = `${common.PIPE}-listen-path-test-report-uv-handles`; | ||
| const sockPath = `${pipeName(true)}-listen-path-test-report-uv-handles`; | ||
| return new Promise((resolve) => { | ||
| const server = net.createServer((socket) => { | ||
| childData.pipe_sock_path = server.address(); | ||
|
|
@@ -202,15 +210,16 @@ if (process.argv[2] === 'child') { | |
| // 1. The server's listening pipe. | ||
| // 2. The inbound pipe making the request. | ||
| // 3. The outbound pipe sending the response. | ||
| // | ||
| // There is no way to distinguish inbound and outbound in a cross | ||
| // platform manner, so we just check inbound here. | ||
| const sockPath = child_data.pipe_sock_path; | ||
| if (handle.localEndpoint === sockPath) { | ||
| if (handle.writable === false) { | ||
| found_named_pipe.push('listening'); | ||
| } else { | ||
| found_named_pipe.push('inbound'); | ||
| } | ||
| } else if (handle.remoteEndpoint === sockPath) { | ||
| found_named_pipe.push('outbound'); | ||
| found_named_pipe.push('inbound'); | ||
| } | ||
| }), | ||
| process: common.mustCall(function process_validator(handle) { | ||
|
|
@@ -251,7 +260,7 @@ if (process.argv[2] === 'child') { | |
| assert(handle.is_referenced); | ||
| }, 2), | ||
| }; | ||
| console.log(report.libuv); | ||
|
|
||
| for (const entry of report.libuv) { | ||
| if (validators[entry.type]) validators[entry.type](entry); | ||
| } | ||
|
|
@@ -261,7 +270,7 @@ if (process.argv[2] === 'child') { | |
| for (const socket of ['connected', 'unconnected']) { | ||
| assert(found_udp.includes(socket), `${socket} UDP socket was not found`); | ||
| } | ||
| for (const socket of ['listening', 'inbound', 'outbound']) { | ||
| for (const socket of ['listening', 'inbound']) { | ||
| assert(found_named_pipe.includes(socket), `${socket} named pipe socket was not found`); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.