fix go test TestSkipEnqueue error, move queue.Run (#2209)
This commit is contained in:
parent
94deb3a01a
commit
f4caa13b28
1 changed files with 2 additions and 2 deletions
|
@ -137,8 +137,6 @@ func TestSkipEnqueue(t *testing.T) {
|
|||
atomic.StoreUint32(&sr, 0)
|
||||
q := NewCustomTaskQueue(mockSynFn, mockKeyFn)
|
||||
stopCh := make(chan struct{})
|
||||
// run queue
|
||||
go q.Run(time.Second, stopCh)
|
||||
// mock object whichi will be enqueue
|
||||
mo := mockEnqueueObj{
|
||||
k: "testKey",
|
||||
|
@ -148,6 +146,8 @@ func TestSkipEnqueue(t *testing.T) {
|
|||
q.Enqueue(mo)
|
||||
q.Enqueue(mo)
|
||||
q.Enqueue(mo)
|
||||
// run queue
|
||||
go q.Run(time.Second, stopCh)
|
||||
// wait for 'mockSynFn'
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
if atomic.LoadUint32(&sr) != 1 {
|
||||
|
|
Loading…
Reference in a new issue