Fix flaky context error test.

This commit is contained in:
mikestefanello 2023-11-15 20:14:00 -05:00
parent ba96445704
commit 0879aaf21d

View File

@ -15,8 +15,8 @@ func TestIsCanceled(t *testing.T) {
cancel()
assert.True(t, IsCanceledError(ctx.Err()))
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond)
time.Sleep(time.Microsecond * 5)
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond*5)
<-ctx.Done()
cancel()
assert.False(t, IsCanceledError(ctx.Err()))