2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-26 11:16:12 +08:00

Fix subscriber to not panic when it cannot establish pubsub channel on

startup
This commit is contained in:
Ken Hibino
2020-04-16 08:58:44 -07:00
parent 4ec2dc9e47
commit 42453280f4
2 changed files with 26 additions and 7 deletions

View File

@@ -41,12 +41,15 @@ func TestSubscriber(t *testing.T) {
var wg sync.WaitGroup
subscriber.start(&wg)
// wait for subscriber to establish connection to pubsub channel
time.Sleep(time.Second)
if err := rdbClient.PublishCancelation(tc.publishID); err != nil {
subscriber.terminate()
t.Fatalf("could not publish cancelation message: %v", err)
}
// allow for redis to publish message
// wait for redis to publish message
time.Sleep(time.Second)
mu.Lock()