consul sd tests: don't call FailNow from a background goroutine

This is not allowed by the Go test framework.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2024-02-01 15:01:48 +00:00
parent 46008fdecd
commit b17f88b7fb

View file

@ -253,7 +253,7 @@ func newServer(t *testing.T) (*httptest.Server, *SDConfig) {
time.Sleep(5 * time.Second)
response = ServicesTestAnswer
default:
require.FailNow(t, "Unhandled consul call: %s", r.URL)
t.Errorf("Unhandled consul call: %s", r.URL)
}
w.Header().Add("X-Consul-Index", "1")
w.Write([]byte(response))