mirror of https://github.com/v2ray/v2ray-core
parent
53870f1ea7
commit
42e4f06fe9
|
@ -14,7 +14,7 @@ func TestActivityTimer(t *testing.T) {
|
||||||
assert := With(t)
|
assert := With(t)
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
timer := CancelAfterInactivity(ctx, cancel, time.Second*5)
|
timer := CancelAfterInactivity(ctx, cancel, time.Second*4)
|
||||||
time.Sleep(time.Second * 6)
|
time.Sleep(time.Second * 6)
|
||||||
assert(ctx.Err(), IsNotNil)
|
assert(ctx.Err(), IsNotNil)
|
||||||
runtime.KeepAlive(timer)
|
runtime.KeepAlive(timer)
|
||||||
|
|
Loading…
Reference in New Issue