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

🐛 BUG: Fails to run workers vitest on macOS 15.1.1 but works on Debian 12 #7569

Open
rwv opened this issue Dec 17, 2024 · 1 comment
Open
Labels
bug Something that isn't working needs reproduction Needs reproduction from OP

Comments

@rwv
Copy link
Contributor

rwv commented Dec 17, 2024

Which Cloudflare product(s) does this pertain to?

Workers Vitest Integration

What version(s) of the tool(s) are you using?

  '@cloudflare/vitest-pool-workers':         specifier: ^0.5.37         version: 0.5.37(@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@types/[email protected]))

What version of Node are you using?

20.14.0 / 22.12.0

What operating system and version are you using?

macOS 15.1.1

Describe the Bug

Observed behavior

Works on Debian 12 but failed on macOS 15.1.1

      '@cloudflare/vitest-pool-workers':
        specifier: ^0.5.37
        version: 0.5.37(@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@types/[email protected]))

Steps to reproduce

Please provide the following:

vitest.config.ts

import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";

export default defineWorkersConfig({
  test: {
    setupFiles: ["./test-env-setup.ts"],
    poolOptions: {
      workers: {
        wrangler: { configPath: "./wrangler.toml" },
      },
    },
    coverage: {
      provider: "istanbul", // or 'v8'
      reporter: ["text", "json-summary", "json", "html", "clover"],
      thresholds: {
        100: true,
      },
      include: ["src"],
    },
  },
});

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

stack: 104d9ae4b 104d9b027 104d6b263 104d95614 10292f50c 10321b8fc 104d8ca48 1037fd707 1037fe057 1037ffc3b 1037e5054 1037ea894 102923c87 10292328f; spec = /?specifier=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Fselect.types.js&referrer=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Findex.js&rawSpecifier=.%2Fselect.types.js
workerd/jsg/util.c++:274: error: e = kj/async-io-unix.c++:1510: failed: connect(): Can't assign requested address; address = 127.0.0.1:51756
stack: 104d9734f 104d94ffb 104d95614 10292f50c 10293c19b 10321b8fc 104d8ca48 1037fd707 1037fe057 1037ffc3b 1037e5054 1037ea894 1037fade8 1028ebd8c 10300bb40 102f44c98; sentryErrorContext = jsgInternalError
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in promise); stack = Error: internal error
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in response); stack = Error: internal error
Error running worker: Error: internal error
    at WorkersTestRunner.updateStackedStorage (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:125:17)
    at WorkersTestRunner.onBeforeRunSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:159:5)
    at runSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1155:3)
    at runFiles (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1262:5)
    at startTests (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1271:3)
    at Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:126:11
    at withEnv (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:90:5)
    at run (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:112:3)
    at runBaseTests (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/base.BZZh4cSm.js:29:3)
    at execute (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/worker.js:127:5)
workerd/server/server.c++:3058: error: Fallback service failed to fetch module; exception = kj/async-io-unix.c++:1525: disconnected: connect(): Connection refused
stack: 1027e2e4b 1027e3027 1027b3263 1027dd614 10037750c 100c638fc 1027d4a48 101245707 101246057 101247c3b 10122d054 101232894 10036bc87 10036b28f; spec = /?specifier=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Fselect.js&referrer=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Findex.js&rawSpecifier=.%2Fselect.js
workerd/jsg/util.c++:274: error: e = kj/async-io-unix.c++:1510: failed: connect(): Can't assign requested address; address = 127.0.0.1:51772
stack: 1027df34f 1027dcffb 1027dd614 10037750c 10038419b 100c638fc 1027d4a48 101245707 101246057 101247c3b 10122d054 101232894 101242de8 100333d8c 100a53b40 10098cc98; sentryErrorContext = jsgInternalError
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in promise); stack = Error: internal error
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in response); stack = Error: internal error
Error running worker: Error: internal error
    at WorkersTestRunner.updateStackedStorage (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:125:17)
    at WorkersTestRunner.onBeforeRunSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:159:5)
    at runSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1155:3)
    at runFiles (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1262:5)
    at startTests (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1271:3)
    at Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:126:11
    at withEnv (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:90:5)
    at run (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:112:3)
    at runBaseTests (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/base.BZZh4cSm.js:29:3)
    at execute (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/worker.js:127:5)
workerd/server/server.c++:3058: error: Fallback service failed to fetch module; exception = kj/async-io-unix.c++:1525: disconnected: connect(): Connection refused
stack: 10700ee4b 10700f027 106fdf263 107009614 104ba350c 10548f8fc 107000a48 105a71707 105a72057 105a73c3b 105a59054 105a5e894 104b97c87 104b9728f; spec = /?specifier=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Fselect.js&referrer=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Findex.js&rawSpecifier=.%2Fselect.js
workerd/jsg/util.c++:274: error: e = kj/async-io-unix.c++:1510: failed: connect(): Can't assign requested address; address = 127.0.0.1:51750
stack: 10700b34f 107008ffb 107009614 104ba350c 104bb019b 10548f8fc 107000a48 105a71707 105a72057 105a73c3b 105a59054 105a5e894 105a6ede8 104b5fd8c 10527fb40 1051b8c98; sentryErrorContext = jsgInternalError
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in promise); stack = Error: internal error
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in response); stack = Error: internal error
Error running worker: Error: internal error
    at WorkersTestRunner.updateStackedStorage (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:125:17)
    at WorkersTestRunner.onBeforeRunSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:159:5)
    at runSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1155:3)
    at runFiles (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1262:5)
    at startTests (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1271:3)
    at Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:126:11
    at withEnv (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:90:5)
    at run (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:112:3)
    at runBaseTests (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/base.BZZh4cSm.js:29:3)
    at execute (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/worker.js:127:5)
workerd/server/server.c++:3058: error: Fallback service failed to fetch module; exception = kj/async-io-unix.c++:1525: disconnected: connect(): Connection refused
stack: 104d96e4b 104d97027 104d67263 104d91614 10292b50c 1032178fc 104d88a48 1037f9707 1037fa057 1037fbc3b 1037e1054 1037e6894 10291fc87 10291f28f; spec = /?specifier=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Fselect.js&referrer=%2FUsers%2Fuser%2FCode%2Ftest-project%2Fnode_modules%2F.pnpm%2Fdrizzle-orm%400.38.2_%40cloudflare%2Bworkers-types%404.20241205.0_%40libsql%2Bclient-wasm%400.14.0%2Fnode_modules%2Fdrizzle-orm%2Fsqlite-core%2Fquery-builders%2Findex.js&rawSpecifier=.%2Fselect.js
workerd/jsg/util.c++:274: error: e = kj/async-io-unix.c++:1510: failed: connect(): Can't assign requested address; address = 127.0.0.1:51776
stack: 104d9334f 104d90ffb 104d91614 10292b50c 10293819b 1032178fc 104d88a48 1037f9707 1037fa057 1037fbc3b 1037e1054 1037e6894 1037f6de8 1028e7d8c 103007b40 102f40c98; sentryErrorContext = jsgInternalError
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in promise); stack = Error: internal error
workerd/io/worker.c++:2067: info: uncaught exception; source = Uncaught (in response); stack = Error: internal error
Error running worker: Error: internal error
    at WorkersTestRunner.updateStackedStorage (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:125:17)
    at WorkersTestRunner.onBeforeRunSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]_@[email protected]_@vitest+runner@_ypgotjharrdkzq5qfx6jumfixy/node_modules/@cloudflare/vitest-pool-workers/dist/worker/lib/cloudflare/test-runner.mjs:159:5)
    at runSuite (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1155:3)
    at runFiles (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1262:5)
    at startTests (Users/user/Code/test-project/node_modules/.pnpm/@[email protected]/node_modules/@vitest/runner/dist/index.js:1271:3)
    at Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:126:11
    at withEnv (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:90:5)
    at run (Users/user/Code/test-project/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vitest/dist/chunks/runBaseTests.3qpJU

 ❯ src/router.test.ts (0)
 ❯ src/logic/users/user/get-user-info.test.ts (0)
 ❯ src/logic/scan-jobs/create-scan-job.test.ts (0)
 ❯ src/logic/users/user/get-user-id.test.ts (0)
 ❯ src/logic/users/token/token.test.ts (0)
 ❯ src/logic/scan-jobs/storage/aws-client.test.ts (0)

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: fetch failed
 ❯ fetch node_modules/.pnpm/[email protected]/node_modules/undici/index.js:112:15
 ❯ process.processTicksAndRejections node:internal/process/task_queues:105:5
 ❯ MessagePort.<anonymous> [worker eval]:28:22

Caused by: Error: connect EADDRNOTAVAIL 127.0.0.1:52878 - Local (0.0.0.0:0)
 ❯ internalConnect node:net:1104:16
 ❯ defaultTriggerAsyncIdScope node:internal/async_hooks:464:18
 ❯ node:net:1334:9
 ❯ process.processTicksAndRejections node:internal/process/task_queues:85:11
@rwv rwv added the bug Something that isn't working label Dec 17, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 17, 2024
@andyjessop
Copy link
Contributor

@rwv thanks very much for reporting this! Would you be able to provide more information regarding the setup and code - ideally a minimal reproduction that we can use to debug. I'm unable to reproduce this locally (I have the same MacOS version)

@andyjessop andyjessop added the needs reproduction Needs reproduction from OP label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working needs reproduction Needs reproduction from OP
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants