open-consul/command/login
Daniel Nephin 4f0d092c95 testing: remove unnecessary calls to freeport
Previously we believe it was necessary for all code that required ports
to use freeport to prevent conflicts.

https://github.com/dnephin/freeport-test shows that it is actually save
to use port 0 (`127.0.0.1:0`) as long as it is passed directly to
`net.Listen`, and the listener holds the port for as long as it is
needed.

This works because freeport explicitly avoids the ephemeral port range,
and port 0 always uses that range. As you can see from the test output
of https://github.com/dnephin/freeport-test, the two systems never use
overlapping ports.

This commit converts all uses of freeport that were being passed
directly to a net.Listen to use port 0 instead. This allows us to remove
a bit of wrapping we had around httptest, in a couple places.
2021-11-29 12:19:43 -05:00
..
login.go add partition cli flag to all cli commands that have namespace flag (#10668) 2021-07-21 14:45:24 -05:00
login_oss.go re-run gofmt on 1.17 (#11579) 2021-11-16 12:04:01 -06:00
login_test.go testing: remove unnecessary calls to freeport 2021-11-29 12:19:43 -05:00