File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ func TestTimeoutWithFullEchoStack(t *testing.T) {
375
375
376
376
// NOTE: timeout middleware is first as it changes Response.Writer and causes data race for logger middleware if it is not first
377
377
e .Use (TimeoutWithConfig (TimeoutConfig {
378
- Timeout : 15 * time .Millisecond ,
378
+ Timeout : 100 * time .Millisecond ,
379
379
}))
380
380
e .Use (Logger ())
381
381
e .Use (Recover ())
@@ -403,8 +403,13 @@ func TestTimeoutWithFullEchoStack(t *testing.T) {
403
403
}
404
404
if tc .whenForceHandlerTimeout {
405
405
wg .Done ()
406
+ // extremely short periods are not reliable for tests when it comes to goroutines. We can not guarantee in which
407
+ // order scheduler decides do execute: 1) request goroutine, 2) timeout timer goroutine.
408
+ // most of the time we get result we expect but Mac OS seems to be quite flaky
409
+ time .Sleep (50 * time .Millisecond )
410
+
406
411
// shutdown waits for server to shutdown. this way we wait logger mw to be executed
407
- ctx , cancel := context .WithTimeout (context .Background (), 150 * time .Millisecond )
412
+ ctx , cancel := context .WithTimeout (context .Background (), 200 * time .Millisecond )
408
413
defer cancel ()
409
414
server .Shutdown (ctx )
410
415
}
You can’t perform that action at this time.
0 commit comments