Flaky-test: SubscriptionSeekTest.testShouldCloseAllConsumersForMultipleConsumerDispatcherWhenSeek
@@ -560,7 +560,7 @@ public class SubscriptionSeekTest extends BrokerTestBase {
.subscriptionName("my-subscription")
.subscribe();
- pulsarClient.newConsumer()
+ org.apache.pulsar.client.api.Consumer<byte[]> consumer2 = pulsarClient.newConsumer()
.topic(topicName)
.subscriptionType(SubscriptionType.Shared)
.subscriptionName("my-subscription")
@@ -579,12 +579,15 @@ public class SubscriptionSeekTest extends BrokerTestBase {
consumer1.seek(MessageId.earliest);
// Wait for consumer to reconnect
Awaitility.await().until(consumer1::isConnected);
+ Awaitility.await().until(consumer2::isConnected);
consumers = topicRef.getSubscriptions().get("my-subscription").getConsumers();
assertEquals(consumers.size(), 2);
for (Consumer consumer : consumers) {
assertFalse(connectedSinceSet.contains(consumer.getStats().getConnectedSince()));
}
+ consumer1.close();
+ consumer2.close();
}
@Test
