mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-26 01:01:01 +00:00
Force IPv4 for the mock TCP listener.
Travis CI [does not have IPv6][0] in any environment. It could be [enabled][1] if we ran the build in a VM, but that is much slower to start. Instead, we just force the test connection to use IPv4. [0]: https://blog.travis-ci.com/2015-11-27-moving-to-a-more-elastic-future#ipv6-no-longer-present [1]: https://github.com/travis-ci/travis-ci/issues/5200#issuecomment-162539556
This commit is contained in:
parent
92702b80fd
commit
ea77554dc4
1 changed files with 3 additions and 1 deletions
|
@ -124,7 +124,9 @@ type mockStatsDTCPListener struct {
|
|||
}
|
||||
|
||||
func (ml *mockStatsDTCPListener) handlePacket(packet []byte, e chan<- Events) {
|
||||
lc, err := net.ListenTCP("tcp", nil)
|
||||
// Forcing IPv4 because the TravisCI build environment does not have IPv6
|
||||
// addresses.
|
||||
lc, err := net.ListenTCP("tcp4", nil)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("mockStatsDTCPListener: listen failed: %v", err))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue