延迟无锁队列测试用例优化

This commit is contained in:
fantasticbin 2024-12-03 10:49:09 +08:00
parent 39970847c6
commit 6f0dd4955d

View File

@ -19,14 +19,15 @@ func TestDelayLkQueue(t *testing.T) {
q.DelayEnqueue(c.value, c.duration) q.DelayEnqueue(c.value, c.duration)
} }
notidy := make(chan int) notify := make(chan int)
go func() { go func() {
for data := range notidy { for data := range notify {
t.Log(data) t.Log(data)
t.Log(time.Now().Unix()) t.Log(time.Now().Unix())
} }
}() }()
go q.ContinuousDequeue(notidy) go q.ContinuousDequeue(notify)
time.Sleep(time.Second * 5) time.Sleep(time.Second * 5)
close(notify)
} }