mirror of
https://github.com/acaloiaro/neoq
synced 2026-07-21 10:12:18 +00:00
Make multiple queue test less finicky
This commit is contained in:
parent
040c0de7db
commit
6a368e05fc
1 changed files with 20 additions and 18 deletions
|
|
@ -204,25 +204,27 @@ func TestBasicJobMultipleQueue(t *testing.T) {
|
|||
t.Error(err)
|
||||
}
|
||||
|
||||
jid, e := nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue,
|
||||
Payload: map[string]interface{}{
|
||||
"message": fmt.Sprintf("hello world: %d", internal.RandInt(10000000000)),
|
||||
},
|
||||
})
|
||||
if e != nil || jid == jobs.DuplicateJobID {
|
||||
t.Error(e)
|
||||
}
|
||||
go func() {
|
||||
jid, e := nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue,
|
||||
Payload: map[string]interface{}{
|
||||
"message": fmt.Sprintf("hello world: %d", internal.RandInt(10000000000)),
|
||||
},
|
||||
})
|
||||
if e != nil || jid == jobs.DuplicateJobID {
|
||||
t.Error(e)
|
||||
}
|
||||
|
||||
jid2, e := nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue2,
|
||||
Payload: map[string]interface{}{
|
||||
"message": fmt.Sprintf("hello world: %d", internal.RandInt(10000000000)),
|
||||
},
|
||||
})
|
||||
if e != nil || jid2 == jobs.DuplicateJobID {
|
||||
t.Error(e)
|
||||
}
|
||||
jid2, e := nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue2,
|
||||
Payload: map[string]interface{}{
|
||||
"message": fmt.Sprintf("hello world: %d", internal.RandInt(10000000000)),
|
||||
},
|
||||
})
|
||||
if e != nil || jid2 == jobs.DuplicateJobID {
|
||||
t.Error(e)
|
||||
}
|
||||
}()
|
||||
|
||||
results_loop:
|
||||
for {
|
||||
|
|
|
|||
Loading…
Reference in a new issue