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

Flaky tests for websockets #259

Open
B4nan opened this issue Nov 27, 2023 · 0 comments
Open

Flaky tests for websockets #259

B4nan opened this issue Nov 27, 2023 · 0 comments
Assignees
Labels
infrastructure Issues related to infrastructure or CI/CD pipeline. t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@B4nan
Copy link
Member

B4nan commented Nov 27, 2023

After the vitest refactor, sometimes the CI fails with the following error:

⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯ Uncaught Exception ⎯⎯⎯⎯⎯
Error: listen EADDRINUSE: address already in use :::9099
 ❯ Server.setupListenHandle [as _listen2] node:net:1463:16
 ❯ listenInCluster node:net:1511:12
 ❯ Server.listen node:net:1599:7
 ❯ new WebSocketServer node_modules/ws/lib/websocket-server.js:90:20
 ❯ test/apify/events.test.ts:15:15
     13| 
     14|     beforeEach(() => {
     15|         wss = new WebSocket.Server({ port: 9099 });
       |               ^
     16|         vitest.useFakeTimers();
     17|         process.env[ACTOR_ENV_VARS.EVENTS_WEBSOCKET_URL] = 'ws://local…
 ❯ node_modules/@vitest/runner/dist/index.js:135:14
 ❯ node_modules/@vitest/runner/dist/index.js:58:[26](https://github.com/apify/apify-sdk-js/actions/runs/7004682693/job/19052930717?pr=257#step:9:27)
 ❯ node_modules/@vitest/runner/dist/index.js:582:59
 ❯ callSuiteHook node_modules/@vitest/runner/dist/index.js:582:47

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'EADDRINUSE', errno: -98, syscall: 'listen', address: '::', port: 9099 }
This error originated in "test/apify/events.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
The latest test that might've caused the error is "should send persist state events in regular interval". It might mean one of the following:
- The error was thrown, while Vitest was running this test.
- This was the last recorded test before the error was thrown, if error originated after test finished its execution.

https://github.com/apify/apify-sdk-js/actions/runs/7004682693/job/19052930717?pr=257

@B4nan B4nan added infrastructure Issues related to infrastructure or CI/CD pipeline. t-tooling Issues with this label are in the ownership of the tooling team. labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues related to infrastructure or CI/CD pipeline. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

2 participants