open-nomad/helper/freeport
Seth Hoenig f0c3dca49c tests: swap lib/freeport for tweaked helper/freeport
Copy the updated version of freeport (sdk/freeport), and tweak it for use
in Nomad tests. This means staying below port 10000 to avoid conflicts with
the lib/freeport that is still transitively used by the old version of
consul that we vendor. Also provide implementations to find ephemeral ports
of macOS and Windows environments.

Ports acquired through freeport are supposed to be returned to freeport,
which this change now also introduces. Many tests are modified to include
calls to a cleanup function for Server objects.

This should help quite a bit with some flakey tests, but not all of them.
Our port problems will not go away completely until we upgrade our vendor
version of consul. With Go modules, we'll probably do a 'replace' to swap
out other copies of freeport with the one now in 'nomad/helper/freeport'.
2019-12-09 08:37:32 -06:00
..
ephemeral_darwin.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
ephemeral_darwin_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
ephemeral_linux.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
ephemeral_linux_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
ephemeral_windows.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
freeport.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00
freeport_test.go tests: swap lib/freeport for tweaked helper/freeport 2019-12-09 08:37:32 -06:00