Merge pull request #104 from prometheus/mr/fix-tests

Fix TravisCI tests: Force IPv4 for the mock TCP listener
This commit is contained in:
Matthias Rampke 2017-11-10 16:01:39 +01:00 committed by GitHub
commit ff308119cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))
}