uber-go/fx

Example test failing in master branch when port 8080 is already in use (89f4a90)

Opened this issue · 3 comments

Describe the bug
At rev 89f4a90 Example test is failing

To Reproduce
run anything that listens on port 8080, then make test

Expected behavior
Passing tests

Additional context

--- FAIL: Example (0.00s)
got:
Executing NewLogger.
Executing NewMux.
Executing NewHandler.
Starting HTTP server.
Stopping HTTP server.
want:
Executing NewLogger.
Executing NewMux.
Executing NewHandler.
Starting HTTP server.
Got a request.
Stopping HTTP server.
FAIL

Test passes for me, and in CI, FWIW.
Where are you running this?

Hi Jason! good to see ya around again 👋

Seems like I can't repro this either on any of my machines. Is this reproing consistently for you? or is it flaky

@sywhang @abhinav I discovered the issue, which is that in my environment port 8080 is not available to bind too, which causes the tests to fail. These should likely be moved to using port a random port and fx.Populate a net.Addr type to use with clients.