seventh version

This commit is contained in:
2026-06-08 11:11:50 +00:00
parent 8a552dec56
commit ebea17b411
11 changed files with 511 additions and 138 deletions
+3 -3
View File
@@ -25,9 +25,9 @@ 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
_, err := requestWithTimeout(context.Background(), time.Millisecond, func(ctx context.Context) (int, error) {
<-ctx.Done()
return 0, ctx.Err()
})
if !errors.Is(err, context.DeadlineExceeded) {
t.Fatalf("err=%v, want DeadlineExceeded", err)