Skip to content

fix(p3-shim): avoid flakiness in http test #761

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

Conversation

vados-cosmonic
Copy link
Collaborator

The HTTP tests seem to cause some flakiness, so let's randomize the ports to avoid collisions first.

 ⎯⎯⎯⎯⎯⎯ 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: read ECONNRESET
 ❯ TCP.onStreamRead node:internal/stream_base_commons:218:20

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errno: -104, code: 'ECONNRESET', syscall: 'read' }
This error originated in "test/http.test.js" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Likely the fix will be to add retries to the specific test that's failing, but since there's no obvious source, this refactor reduces the likelihood and if the flakes reappear we can drill down to the relevant test and add retries in case network is flaky (though localhost really should not be).

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic vados-cosmonic changed the title fix(p3 shim): retry flaky http test fix(p3 shim): avoid flakiness in http test Jun 17, 2025
@vados-cosmonic vados-cosmonic changed the title fix(p3 shim): avoid flakiness in http test fix(p3-shim): avoid flakiness in http test Jun 17, 2025
@vados-cosmonic vados-cosmonic added this pull request to the merge queue Jun 17, 2025
Merged via the queue into bytecodealliance:main with commit 6dbc922 Jun 17, 2025
27 checks passed
@vados-cosmonic vados-cosmonic deleted the fix(p3-shim)=retry-flaky-http-test branch June 17, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants