diff --git a/pkg/context/context_test.go b/pkg/context/context_test.go index 6a5841d..cee5bc7 100644 --- a/pkg/context/context_test.go +++ b/pkg/context/context_test.go @@ -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()))