Skip to content

Commit f2b8503

Browse files
committed
add test to delete large queue
1 parent f04fb8c commit f2b8503

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pkg/backend/redis/redis_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,26 @@ var _ = Describe("Backend", func() {
278278
Expect(err).To(Equal(iface.TaskQueueNotFound))
279279
})
280280
})
281+
When("the large queue exists", func() {
282+
It("can delete the queue", func() {
283+
queue := testutil.MustCreateQueue(backend, SampleQueueSpec)
284+
// numOfTasks % chunkSize != 0 && numOfTasks > chunkSize
285+
numOfTasks := 12345
286+
for i := 0; i < numOfTasks; i++ {
287+
_, err := backend.AddTask(context.Background(), QueueName, SampleTaskSpec)
288+
Expect(err).NotTo(HaveOccurred())
289+
}
290+
291+
Expect(backend.DeleteQueue(context.Background(), SampleQueueSpec.Name)).NotTo(HaveOccurred())
292+
293+
queuesHash, err := client.HGetAll(backend.allQueuesKey()).Result()
294+
Expect(err).NotTo(HaveOccurred())
295+
Expect(len(queuesHash)).To(Equal(0))
296+
keys, err := client.Keys(backend.queueKey(queue.UID.String()) + "*").Result()
297+
Expect(err).NotTo(HaveOccurred())
298+
Expect(len(keys)).To(Equal(0))
299+
})
300+
})
281301
})
282302
})
283303

0 commit comments

Comments
 (0)