Skip to content
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

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
8 changes: 8 additions & 0 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ junit.xml

# Jupyter files
.ipynb_checkpoints/
Untitled*.ipynb
Untitled*.ipynb

# playwright browser binary cache
/.ms-playwright
7 changes: 3 additions & 4 deletions ext/node/polyfills/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ export class Socket extends Duplex {

super(options);

// Note: If the socket is created from one of `pkgNeedsSockInitWorkaround`,
// Note: If the TCP/TLS socket is created from one of `pkgNeedsSockInitWorkaround`,
// the 'socket' event on ClientRequest object happens after 'connect' event on Socket object.
// That swaps the sequence of op_node_http_request_with_conn() call and
// initial socket read. That causes op_node_http_request_with_conn() not
Expand All @@ -1249,9 +1249,8 @@ export class Socket extends Duplex {
// (and also skips the startTls call if it's TLSSocket)
// TODO(kt3k): Remove this workaround
const errorStack = new Error().stack;
this._needsSockInitWorkaround = pkgsNeedsSockInitWorkaround.some((pkg) =>
errorStack?.includes(pkg)
);
this._needsSockInitWorkaround = options.handle?.ipc !== true &&
pkgsNeedsSockInitWorkaround.some((pkg) => errorStack?.includes(pkg));
if (this._needsSockInitWorkaround) {
this.pause();
}
Expand Down
Binary file added tests/registry/npm/fsevents/fsevents-2.3.2.tgz
Binary file not shown.
103 changes: 74 additions & 29 deletions tests/registry/npm/fsevents/registry.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,109 @@
{
"name": "fsevents",
"description": "Native Access to MacOS FSEvents",
"dist-tags": {
"latest": "2.3.3"
},
"versions": {
"2.3.3": {
"2.3.2": {
"name": "fsevents",
"version": "2.3.3",
"description": "Native Access to MacOS FSEvents",
"main": "fsevents.js",
"types": "fsevents.d.ts",
"version": "2.3.2",
"license": "MIT",
"_id": "[email protected]",
"bugs": {
"url": "https://github.com/fsevents/fsevents/issues"
},
"os": [
"darwin"
],
"dist": {
"shasum": "8a526f78b8fdf4623b709e0b975c52c24c02fd1a",
"tarball": "http://localhost:4260/fsevents/fsevents-2.3.2.tgz",
"fileCount": 6,
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"unpackedSize": 156422
},
"main": "fsevents.js",
"types": "fsevents.d.ts",
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
},
"gitHead": "a7f5d00939b74e141a73131468c4ce48ee0f2197",
"gypfile": true,
"scripts": {
"clean": "node-gyp clean && rm -f fsevents.node",
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",
"test": "/bin/bash ./test.sh 2>/dev/null",
"prepublishOnly": "npm run build",
"install": "node-gyp rebuild"
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",
"clean": "node-gyp clean && rm -f fsevents.node",
"install": "node-gyp rebuild",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fsevents/fsevents.git"
"url": "git+https://github.com/fsevents/fsevents.git",
"type": "git"
},
"_npmVersion": "6.14.10",
"description": "Native Access to MacOS FSEvents",
"directories": {},
"_nodeVersion": "12.20.1",
"_hasShrinkwrap": false,
"devDependencies": {
"node-gyp": "^6.1.0"
}
},
"2.3.3": {
"name": "fsevents",
"version": "2.3.3",
"license": "MIT",
"_id": "[email protected]",
"bugs": {
"url": "https://github.com/fsevents/fsevents/issues"
},
"devDependencies": {
"node-gyp": "^9.4.0"
},
"gypfile": true,
"gitHead": "2db891e51aa0f2975c5eaaf6aa30f13d720a830a",
"_id": "[email protected]",
"_nodeVersion": "18.17.1",
"_npmVersion": "9.6.7",
"os": [
"darwin"
],
"dist": {
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"shasum": "cac6407785d03675a2a5e1a5305c697b347d90d6",
"tarball": "http://localhost:4260/fsevents/fsevents-2.3.3.tgz",
"fileCount": 6,
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"unpackedSize": 173224
},
"main": "fsevents.js",
"types": "fsevents.d.ts",
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
},
"gitHead": "2db891e51aa0f2975c5eaaf6aa30f13d720a830a",
"gypfile": true,
"scripts": {
"test": "/bin/bash ./test.sh 2>/dev/null",
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",
"clean": "node-gyp clean && rm -f fsevents.node",
"install": "node-gyp rebuild",
"prepublishOnly": "npm run build"
},
"repository": {
"url": "git+https://github.com/fsevents/fsevents.git",
"type": "git"
},
"_npmVersion": "9.6.7",
"description": "Native Access to MacOS FSEvents",
"directories": {},
"_hasShrinkwrap": false
"_nodeVersion": "18.17.1",
"_hasShrinkwrap": false,
"devDependencies": {
"node-gyp": "^9.4.0"
}
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/fsevents/fsevents.git"
},
"readmeFilename": "README.md",
"homepage": "https://github.com/fsevents/fsevents",
"bugs": {
"url": "https://github.com/fsevents/fsevents/issues"
},
"license": "MIT"
"license": "MIT",
"homepage": "https://github.com/fsevents/fsevents",
"repository": {
"url": "git+https://github.com/fsevents/fsevents.git",
"type": "git"
},
"description": "Native Access to MacOS FSEvents",
"readmeFilename": "README.md"
}
Binary file not shown.
87 changes: 87 additions & 0 deletions tests/registry/npm/playwright-core/registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "playwright-core",
"dist-tags": {
"latest": "1.49.1"
},
"versions": {
"1.49.1": {
"name": "playwright-core",
"version": "1.49.1",
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0",
"_id": "[email protected]",
"bugs": {
"url": "https://github.com/microsoft/playwright/issues"
},
"bin": {
"playwright-core": "cli.js"
},
"dist": {
"shasum": "32c62f046e950f586ff9e35ed490a424f2248015",
"tarball": "http://localhost:4260/playwright-core/playwright-core-1.49.1.tgz",
"fileCount": 337,
"integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==",
"attestations": {
"url": "https://registry.npmjs.org/-/npm/v1/attestations/[email protected]",
"provenance": {
"predicateType": "https://slsa.dev/provenance/v1"
}
},
"unpackedSize": 7966574
},
"types": "types/types.d.ts",
"engines": {
"node": ">=18"
},
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"default": "./index.js",
"require": "./index.js"
},
"./lib/utils": "./lib/utils/index.js",
"./lib/server": "./lib/server/index.js",
"./package.json": "./package.json",
"./lib/zipBundle": "./lib/zipBundle.js",
"./types/structs": "./types/structs.d.ts",
"./types/protocol": "./types/protocol.d.ts",
"./lib/cli/program": "./lib/cli/program.js",
"./lib/utilsBundle": "./lib/utilsBundle.js",
"./lib/outofprocess": "./lib/outofprocess.js",
"./lib/image_tools/stats": "./lib/image_tools/stats.js",
"./lib/image_tools/compare": "./lib/image_tools/compare.js",
"./lib/server/registry/index": "./lib/server/registry/index.js",
"./lib/image_tools/colorUtils": "./lib/image_tools/colorUtils.js",
"./lib/remote/playwrightServer": "./lib/remote/playwrightServer.js",
"./lib/image_tools/imageChannel": "./lib/image_tools/imageChannel.js"
},
"gitHead": "88bc8afc78ea6ff13d2bbb312b99eb924962766c",
"repository": {
"url": "git+https://github.com/microsoft/playwright.git",
"type": "git"
},
"_npmVersion": "10.8.2",
"description": "A high-level API to automate web browsers",
"directories": {},
"_nodeVersion": "18.20.5",
"_hasShrinkwrap": false
}
},
"bugs": {
"url": "https://github.com/microsoft/playwright/issues"
},
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0",
"homepage": "https://playwright.dev",
"repository": {
"url": "git+https://github.com/microsoft/playwright.git",
"type": "git"
},
"description": "A high-level API to automate web browsers",
"readmeFilename": ""
}
Binary file not shown.
108 changes: 108 additions & 0 deletions tests/registry/npm/playwright/registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"name": "playwright",
"dist-tags": {
"latest": "1.49.1"
},
"versions": {
"1.49.1": {
"name": "playwright",
"version": "1.49.1",
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0",
"_id": "[email protected]",
"bugs": {
"url": "https://github.com/microsoft/playwright/issues"
},
"bin": {
"playwright": "cli.js"
},
"dist": {
"shasum": "830266dbca3008022afa7b4783565db9944ded7c",
"tarball": "http://localhost:4260/playwright/playwright-1.49.1.tgz",
"fileCount": 108,
"integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==",
"attestations": {
"url": "https://registry.npmjs.org/-/npm/v1/attestations/[email protected]",
"provenance": {
"predicateType": "https://slsa.dev/provenance/v1"
}
},
"unpackedSize": 3149816
},
"main": "index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=18"
},
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"default": "./index.js",
"require": "./index.js"
},
"./test": {
"types": "./test.d.ts",
"import": "./test.mjs",
"default": "./test.js",
"require": "./test.js"
},
"./lib/util": "./lib/util.js",
"./types/test": {
"types": "./types/test.d.ts"
},
"./jsx-runtime": {
"import": "./jsx-runtime.mjs",
"default": "./jsx-runtime.js",
"require": "./jsx-runtime.js"
},
"./lib/plugins": "./lib/plugins/index.js",
"./lib/program": "./lib/program.js",
"./package.json": "./package.json",
"./lib/fsWatcher": "./lib/fsWatcher.js",
"./lib/utilsBundle": "./lib/utilsBundle.js",
"./types/testReporter": {
"types": "./types/testReporter.d.ts"
},
"./lib/internalsForTest": "./lib/internalsForTest.js",
"./lib/common/configLoader": "./lib/common/configLoader.js",
"./lib/transform/esmLoader": "./lib/transform/esmLoader.js",
"./lib/transform/transform": "./lib/transform/transform.js",
"./lib/transform/babelBundle": "./lib/transform/babelBundle.js",
"./lib/transform/compilationCache": "./lib/transform/compilationCache.js"
},
"gitHead": "88bc8afc78ea6ff13d2bbb312b99eb924962766c",
"repository": {
"url": "git+https://github.com/microsoft/playwright.git",
"type": "git"
},
"_npmVersion": "10.8.2",
"description": "A high-level API to automate web browsers",
"directories": {},
"_nodeVersion": "18.20.5",
"dependencies": {
"playwright-core": "1.49.1"
},
"_hasShrinkwrap": false,
"optionalDependencies": {
"fsevents": "2.3.2"
}
}
},
"bugs": {
"url": "https://github.com/microsoft/playwright/issues"
},
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0",
"homepage": "https://playwright.dev",
"repository": {
"url": "git+https://github.com/microsoft/playwright.git",
"type": "git"
},
"description": "A high-level API to automate web browsers",
"readmeFilename": ""
}
Loading
Loading