Commit af3e2357 authored by zhouhaibing089's avatar zhouhaibing089 Committed by haibzhou

use monotonic now in TestDelNode

parent 5df28fa1
......@@ -62,6 +62,13 @@ func TestAddNode(t *testing.T) {
}
func TestDelNode(t *testing.T) {
defer func() { now = time.Now }()
var tick int64
now = func() time.Time {
t := time.Unix(tick, 0)
tick++
return t
}
evictor := NewRateLimitedTimedQueue(flowcontrol.NewFakeAlwaysRateLimiter())
evictor.Add("first")
evictor.Add("second")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment