X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7c7dc19ffa0a20fff6d97e51c874bfaca9596b24..cd45aed0312fc44046dcafe1681f5a4dc3ec1512:/sdk/go/keepclient/keepclient_test.go diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go index ff0f57bbe6..3ce4e7425a 100644 --- a/sdk/go/keepclient/keepclient_test.go +++ b/sdk/go/keepclient/keepclient_test.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + package keepclient import ( @@ -36,7 +40,7 @@ type ServerRequiredSuite struct{} type StandaloneSuite struct{} func (s *StandaloneSuite) SetUpTest(c *C) { - ClearCache() + RefreshServiceDiscovery() } func pythonDir() string { @@ -55,7 +59,7 @@ func (s *ServerRequiredSuite) TearDownSuite(c *C) { } func (s *ServerRequiredSuite) SetUpTest(c *C) { - ClearCache() + RefreshServiceDiscovery() } func (s *ServerRequiredSuite) TestMakeKeepClient(c *C) { @@ -107,7 +111,9 @@ func (sph StubPutHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) func RunFakeKeepServer(st http.Handler) (ks KeepServer) { var err error - ks.listener, err = net.ListenTCP("tcp", &net.TCPAddr{Port: 0}) + // If we don't explicitly bind it to localhost, ks.listener.Addr() will + // bind to 0.0.0.0 or [::] which is not a valid address for Dial() + ks.listener, err = net.ListenTCP("tcp", &net.TCPAddr{IP: []byte{127, 0, 0, 1}, Port: 0}) if err != nil { panic(fmt.Sprintf("Could not listen on any port")) } @@ -1247,7 +1253,7 @@ func (s *ServerRequiredSuite) TestMakeKeepClientWithNonDiskTypeService(c *C) { &blobKeepService) c.Assert(err, Equals, nil) defer func() { arv.Delete("keep_services", blobKeepService["uuid"].(string), nil, nil) }() - ClearCache() + RefreshServiceDiscovery() // Make a keepclient and ensure that the testblobstore is included kc, err := MakeKeepClient(arv)