fix(ext/node): do not apply socket-init-workaround to ipc socket (#27779)

This PR resolves 2 issues of Socket class of node compat (both are
related to playwright)

Currently `browser.launch()` of playwright is not working.
`browser.launch` opens PipeTransport (which is based on Pipe/IPC socket)
with the browser process. But that pipe doesn't start reading the data
because of the workaround #27662 (which pauses the socket at the
beginning if it's from playwright-core). This PR fixes this issue by
checking whether the given handle is `ipc` handle or not.

Another issue is that sock-init-workaround for TLS connection stopped
working at #27707 because of the changes of TLS socket initialization
steps. This change fixes the issue by correctly returning the function
in workaround path.

The added case `specs::npm::playwright_compat` checks both fixes with
actual playwright and playwright-core packages.

`browser.launch` issues
closes #16899
closes #27623 

`https.request` issue
closes #27658
This commit is contained in:
Yoshiya Hinosawa 2025-01-28 15:38:45 +09:00 committed by GitHub
parent 3d408e00be
commit 0e47205ebe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 321 additions and 45 deletions

View file

@ -652,6 +652,14 @@ const ci = {
"cache-path": "./target",
},
},
{
name: "Set up playwright cache",
uses: "actions/cache@v4",
with: {
path: "./.ms-playwright",
key: "playwright-${{ runner.os }}-${{ runner.arch }}",
},
},
{
name: "test_format.js",
if: "matrix.job == 'lint' && matrix.os == 'linux'",

View file

@ -383,6 +383,12 @@ jobs:
uses: ./.github/mtime_cache
with:
cache-path: ./target
- name: Set up playwright cache
uses: actions/cache@v4
with:
path: ./.ms-playwright
key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
if: '!(matrix.skip)'
- name: test_format.js
if: '!(matrix.skip) && (matrix.job == ''lint'' && matrix.os == ''linux'')'
run: deno run --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check