Merge pull request #367 from mattbostock/use_localhost_for_tests

Use localhost for tests
This commit is contained in:
Fabian Reinartz 2016-06-07 11:01:57 +02:00
commit 5843dcf673
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ func NewAcceptanceTest(t *testing.T, opts *AcceptanceOpts) *AcceptanceTest {
func freeAddress() string {
// Let the OS allocate a free address, close it and hope
// it is still free when starting Alertmanager.
l, err := net.Listen("tcp4", ":0")
l, err := net.Listen("tcp4", "localhost:0")
if err != nil {
panic(err)
}

View File

@ -227,7 +227,7 @@ type MockWebhook struct {
}
func NewWebhook(c *Collector) *MockWebhook {
l, err := net.Listen("tcp4", ":0")
l, err := net.Listen("tcp4", "localhost:0")
if err != nil {
// TODO(fabxc): if shutdown of mock destinations ever becomes a concern
// we want to shut them down after test completion. Then we might want to