(t *testing.T)
| 116 | } |
| 117 | |
| 118 | func TestQueueInflightCommitEnqueuesTask(t *testing.T) { |
| 119 | conf := &config.Configuration{ |
| 120 | Queue: config.QueueConfig{ |
| 121 | InflightCommitQueue: "inflight_commit_queue", |
| 122 | NumberOfQueues: 1, |
| 123 | }, |
| 124 | } |
| 125 | config.ConfigStore.Store(conf) |
| 126 | |
| 127 | client := asynq.NewClient(asynq.RedisClientOpt{Addr: testRedisAddr()}) |
| 128 | inspector := asynq.NewInspector(asynq.RedisClientOpt{Addr: testRedisAddr()}) |
| 129 | |
| 130 | q := NewQueue(conf, client) |
| 131 | q.Inspector = inspector |
| 132 | |
| 133 | transaction := getTransactionMock(100, false) |
| 134 | transaction.InflightCommitDate = time.Now().Add(1 * time.Hour) |
| 135 | |
| 136 | err := q.QueueInflightCommit(context.Background(), &transaction) |
| 137 | assert.NoError(t, err) |
| 138 | |
| 139 | task, err := inspector.GetTaskInfo(conf.Queue.InflightCommitQueue, transaction.TransactionID) |
| 140 | if err != nil { |
| 141 | return |
| 142 | } |
| 143 | assert.Equal(t, transaction.TransactionID, task.ID) |
| 144 | } |
| 145 | |
| 146 | func TestEnqueueWithAsynqClientEnqueueError(t *testing.T) { |
| 147 | conf := &config.Configuration{ |
nothing calls this directly
no test coverage detected