Skip to content

Commit 00a4f67

Browse files
committed
Reduce TestClientWithRequestTimeout flakiness
The test sometimes failed because no error was returned: === Failed === FAIL: pkg/plugins TestClientWithRequestTimeout (0.00s) client_test.go:254: assertion failed: expected an error, got nil: expected error Possibly caused by a race condition, as the sleep was just 1 ms longer than the timeout; this patch is increasing the sleep in the response to try to reduce flakiness. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d12fc17 commit 00a4f67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/plugins/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func TestClientWithRequestTimeout(t *testing.T) {
242242

243243
timeout := 1 * time.Millisecond
244244
testHandler := func(w http.ResponseWriter, r *http.Request) {
245-
time.Sleep(timeout + 1*time.Millisecond)
245+
time.Sleep(timeout + 10*time.Millisecond)
246246
w.WriteHeader(http.StatusOK)
247247
}
248248

0 commit comments

Comments
 (0)