Skip to content

Commit 78b8f50

Browse files
authored
Merge pull request #2235 from smallstep/herman/fix-flaky-client-timeout-test
Fix flaky client timeout test
2 parents 60c0b0a + 8815e60 commit 78b8f50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ca/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ func TestClient_GetCaURL(t *testing.T) {
10191019

10201020
func TestClient_WithTimeout(t *testing.T) {
10211021
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1022-
time.Sleep(100 * time.Millisecond)
1022+
time.Sleep(200 * time.Millisecond)
10231023
render.JSONStatus(w, r, api.HealthResponse{Status: "ok"}, 200)
10241024
}))
10251025
defer srv.Close()
@@ -1030,8 +1030,8 @@ func TestClient_WithTimeout(t *testing.T) {
10301030
assertion assert.ErrorAssertionFunc
10311031
}{
10321032
{"ok", []ClientOption{WithTransport(http.DefaultTransport)}, assert.NoError},
1033-
{"ok with timeout", []ClientOption{WithTransport(http.DefaultTransport), WithTimeout(time.Second)}, assert.NoError},
1034-
{"fail with timeout", []ClientOption{WithTransport(http.DefaultTransport), WithTimeout(100 * time.Millisecond)}, assert.Error},
1033+
{"ok with timeout", []ClientOption{WithTransport(http.DefaultTransport), WithTimeout(5 * time.Second)}, assert.NoError},
1034+
{"fail with timeout", []ClientOption{WithTransport(http.DefaultTransport), WithTimeout(10 * time.Millisecond)}, assert.Error},
10351035
}
10361036

10371037
for _, tt := range tests {

0 commit comments

Comments
 (0)