-
Notifications
You must be signed in to change notification settings - Fork 42
Description
🐛 Problem
The test helper HTTP servers don't handle errors from server.listen(), causing confusing crashes when the port is already in use or there's a network binding issue.
Affected Files
packages/w3up-client/test/helpers/bucket-server.jspackages/w3up-client/test/helpers/receipts-server.jspackages/w3up-client/test/helpers/gateway-server.jspackages/upload-client/test/helpers/bucket-server.jspackages/upload-client/test/helpers/receipts-server.js
Current Behavior
When a test server fails to start (e.g., port already in use), the process crashes with an unhandled error event:
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::9999
at Server.setupListenHandle [as _listen2] (node:net:1908:16)
at listenInCluster (node:net:1965:12)
at Server.listen (node:net:2067:7)
[... 10+ more lines of stack trace ...]
🔄 Steps to Reproduce
pnpm nx build @storacha/upload-client
cd packages/upload-client/test/helpers
PORT=9999 node [receipts-server.js](http://_vscodecontentref_/1)
PORT=9999 node [receipts-server.js](http://_vscodecontentref_/2)
# => Crashes with unhandled error event
Failed to start server on port 9999: listen EADDRINUSE: address already in use :::9999Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels