Skip to content

Commit a1ba3f3

Browse files
committed
integration_tests/httpcache: add delays + sleeps to force task switching
1 parent b16e3ff commit a1ba3f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

integration_tests/httpcache/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func testBeforeSendAddHeader(ctx context.Context) error {
245245
}
246246

247247
func testRequestCollapse(ctx context.Context) error {
248-
r := getTestReq("", nil, nil)
248+
r := getTestReq("", &query{wait: 1 * time.Second}, nil)
249249

250250
var beforeSendCount int
251251
var mu sync.Mutex
@@ -270,13 +270,15 @@ func testRequestCollapse(ctx context.Context) error {
270270
<-ch
271271
var err error
272272
resp, err = r.Send(ctx, backend)
273+
time.Sleep(10 * time.Millisecond)
273274
errch <- err
274275
}()
275276

276277
go func() {
277278
<-ch
278279
var err error
279280
resp2, err = r2.Send(ctx, backend)
281+
time.Sleep(20 * time.Millisecond)
280282
errch <- err
281283
}()
282284

0 commit comments

Comments
 (0)