From 969d0e35eb700306a5074f3ca9234be51974fd96 Mon Sep 17 00:00:00 2001 From: Lucas Bremgartner Date: Wed, 10 Mar 2021 09:33:15 +0100 Subject: [PATCH] Initialize subscribers for each consumer group --- pubsub/tests/test_pubsub.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pubsub/tests/test_pubsub.go b/pubsub/tests/test_pubsub.go index 9575f9d51..91e823092 100644 --- a/pubsub/tests/test_pubsub.go +++ b/pubsub/tests/test_pubsub.go @@ -1099,6 +1099,9 @@ func generateConsumerGroup(t *testing.T, pubSubConstructor ConsumerGroupPubSubCo // create a pubsub to ensure that the consumer group exists // for those providers that require subscription before publishing messages (e.g. Google Cloud PubSub) pub, sub := pubSubConstructor(t, groupName) + if subInitializer, ok := sub.(message.SubscribeInitializer); ok { + require.NoError(t, subInitializer.SubscribeInitialize(topicName)) + } _, err := sub.Subscribe(context.Background(), topicName) require.NoError(t, err) closePubSub(t, pub, sub)