Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(plugin-consortium-manual): fix port binding - multiple API servers
1. The ConnectRPC port defaults to 6000 in the API server so for test cases where multiple instances of the API server are created and started, we need to specify the ports explicitly in the API server config so that they don't clash with each other casusing the test to fail. 2. The fix here was to simply bind to port 0 for all the ConnectRPC listeners which eliminated the possibility of a clash and the test is passing once again. 3. I also snuck in a quality of life improvement for contributors: the API server will no longer log the entire details of the fastify server that is being used for CRPC thereby reducing the verbosity of the logs by a wide margin. Crash logs that revealed the bug in the test case: ```sh 024-05-31T20:14:00.9554919Z [2024-05-31T20:14:00.953Z] ERROR (api-server): Failed to start ApiServer Error: listen EADDRINUSE: address already in use 127.0.0.1:6000 2024-05-31T20:14:00.95Z at Http2Server.setupListenHandle [as _listen2] (node:net:1817:16) 2024-05-31T20:14:00.95Z at listenInCluster (node:net:1865:12) 2024-05-31T20:14:00.95Z at doListen (node:net:2014:7) 2024-05-31T20:14:00.95Z at processTicksAndRejections (node:internal/process/task_queues:83:21) 2024-05-31T20:14:00.95Z at runNextTicks (node:internal/process/task_queues:64:3) 2024-05-31T20:14:00.95Z at processImmediate (node:internal/timers:447:9) { 2024-05-31T20:14:00.95Z code: 'EADDRINUSE', 2024-05-31T20:14:00.95Z errno: -98, 2024-05-31T20:14:00.95Z syscall: 'listen', 2024-05-31T20:14:00.95Z address: '127.0.0.1', 2024-05-31T20:14:00.95Z port: 6000 2024-05-31T20:14:00.95Z } ``` Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information