mirror of
https://github.com/hibiken/asynq.git
synced 2025-08-19 23:19:10 +08:00
Update RDB.RunAll* methods with task state
This commit is contained in:
@@ -1711,6 +1711,35 @@ func TestRunAllArchivedTasks(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunAllTasksError(t *testing.T) {
|
||||
r := setup(t)
|
||||
defer r.Close()
|
||||
|
||||
tests := []struct {
|
||||
desc string
|
||||
qname string
|
||||
match func(err error) bool
|
||||
}{
|
||||
{
|
||||
desc: "It returns QueueNotFoundError if queue doesn't exist",
|
||||
qname: "nonexistent",
|
||||
match: errors.IsQueueNotFound,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
if _, got := r.RunAllScheduledTasks(tc.qname); !tc.match(got) {
|
||||
t.Errorf("%s: RunAllScheduledTasks returned %v", tc.desc, got)
|
||||
}
|
||||
if _, got := r.RunAllRetryTasks(tc.qname); !tc.match(got) {
|
||||
t.Errorf("%s: RunAllRetryTasks returned %v", tc.desc, got)
|
||||
}
|
||||
if _, got := r.RunAllArchivedTasks(tc.qname); !tc.match(got) {
|
||||
t.Errorf("%s: RunAllArchivedTasks returned %v", tc.desc, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestArchiveRetryTask(t *testing.T) {
|
||||
r := setup(t)
|
||||
defer r.Close()
|
||||
|
Reference in New Issue
Block a user