-
Notifications
You must be signed in to change notification settings - Fork 102
/
redisq_test.go
98 lines (81 loc) · 2.27 KB
/
redisq_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package taskq_test
import (
"testing"
"time"
"github.com/vmihailenco/taskq/v3"
"github.com/vmihailenco/taskq/v3/redisq"
)
func redisqFactory() taskq.Factory {
return redisq.NewFactory()
}
func TestRedisqConsumer(t *testing.T) {
testConsumer(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-consumer"),
})
}
func TestRedisqAckMessage(t *testing.T) {
testConsumerDelete(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-ack-message"),
ReservationTimeout: 1 * time.Second,
})
}
func TestRedisqUnknownTask(t *testing.T) {
testUnknownTask(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-unknown-task"),
})
}
func TestRedisqFallback(t *testing.T) {
testFallback(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-fallback"),
})
}
func TestRedisqDelay(t *testing.T) {
testDelay(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-delay"),
})
}
func TestRedisqRetry(t *testing.T) {
testRetry(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-retry"),
})
}
func TestRedisqNamedMessage(t *testing.T) {
testNamedMessage(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-named-message"),
})
}
func TestRedisqCallOnce(t *testing.T) {
testCallOnce(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-call-once"),
})
}
func TestRedisqLen(t *testing.T) {
testLen(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-queue-len"),
})
}
func TestRedisqRateLimit(t *testing.T) {
testRateLimit(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-rate-limit"),
})
}
func TestRedisqErrorDelay(t *testing.T) {
testErrorDelay(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-delayer"),
})
}
func TestRedisqWorkerLimit(t *testing.T) {
testWorkerLimit(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-worker-limit"),
})
}
func TestRedisqBatchConsumerSmallMessage(t *testing.T) {
testBatchConsumer(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-batch-consumer-small-message"),
}, 100)
}
func TestRedisqBatchConsumerLarge(t *testing.T) {
testBatchConsumer(t, redisqFactory(), &taskq.QueueOptions{
Name: queueName("redisq-batch-processor-large-message"),
}, 64000)
}