sixth version

This commit is contained in:
2026-06-08 09:41:20 +00:00
parent 2d57c4ff1f
commit 8a552dec56
25 changed files with 545 additions and 130 deletions
+10
View File
@@ -24,6 +24,16 @@ func TestWithRetryRetriesUntilSuccess(t *testing.T) {
}
}
func TestRequestWithTimeoutReturnsDeadline(t *testing.T) {
_, err := requestWithTimeout(context.Background(), time.Millisecond, func() (int, error) {
time.Sleep(50 * time.Millisecond)
return 1, nil
})
if !errors.Is(err, context.DeadlineExceeded) {
t.Fatalf("err=%v, want DeadlineExceeded", err)
}
}
func TestWithRetryStopsOnContextCancel(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()