Merge pull request #23627 from alrs/fix-backend-remote-state-dropped-test-errs
Fix backend remote state dropped test errors
This commit is contained in:
commit
41675543c8
|
@ -26,7 +26,7 @@ func TestHTTPClient(t *testing.T) {
|
|||
|
||||
url, err := url.Parse(ts.URL)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
t.Fatalf("Parse: %s", err)
|
||||
}
|
||||
|
||||
// Test basic get/update
|
||||
|
@ -73,6 +73,10 @@ func TestHTTPClient(t *testing.T) {
|
|||
UpdateMethod: "PUT",
|
||||
Client: retryablehttp.NewClient(),
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("Parse: %s", err)
|
||||
}
|
||||
|
||||
remote.TestClient(t, client) // first time through: 201
|
||||
remote.TestClient(t, client) // second time, with identical data: 204
|
||||
|
||||
|
@ -83,18 +87,13 @@ func TestHTTPClient(t *testing.T) {
|
|||
defer ts.Close()
|
||||
|
||||
url, err = url.Parse(ts.URL)
|
||||
if err != nil {
|
||||
t.Fatalf("Parse: %s", err)
|
||||
}
|
||||
client = &httpClient{URL: url, Client: retryablehttp.NewClient()}
|
||||
remote.TestClient(t, client)
|
||||
}
|
||||
|
||||
func assertError(t *testing.T, err error, expected string) {
|
||||
if err == nil {
|
||||
t.Fatalf("Expected empty config to err")
|
||||
} else if err.Error() != expected {
|
||||
t.Fatalf("Expected err.Error() to be \"%s\", got \"%s\"", expected, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
type testHTTPHandler struct {
|
||||
Data []byte
|
||||
Locked bool
|
||||
|
|
Loading…
Reference in New Issue