Fixed potential test failures due to timing.
This commit is contained in:
parent
acebcf0ba0
commit
8fa6ebb8cf
2 changed files with 4 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ func TestIsCanceled(t *testing.T) {
|
|||
assert.True(t, IsCanceledError(ctx.Err()))
|
||||
|
||||
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond)
|
||||
time.Sleep(time.Microsecond * 2)
|
||||
time.Sleep(time.Microsecond * 5)
|
||||
cancel()
|
||||
assert.False(t, IsCanceledError(ctx.Err()))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue