Skip to content

Commit

Permalink
Flaky-test: SubscriptionSeekTest.testShouldCloseAllConsumersForMultip…
Browse files Browse the repository at this point in the history
…leConsumerDispatcherWhenSeek (#14674)

(cherry picked from commit 157b808)
  • Loading branch information
shibd authored and codelipenghui committed Mar 18, 2022
1 parent 2cb1681 commit 1321201
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public void testShouldCloseAllConsumersForMultipleConsumerDispatcherWhenSeek() t
.subscriptionName("my-subscription")
.subscribe();

pulsarClient.newConsumer()
org.apache.pulsar.client.api.Consumer<byte[]> consumer2 = pulsarClient.newConsumer()
.topic(topicName)
.subscriptionType(SubscriptionType.Shared)
.subscriptionName("my-subscription")
Expand All @@ -579,12 +579,15 @@ public void testShouldCloseAllConsumersForMultipleConsumerDispatcherWhenSeek() t
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
Expand Down

0 comments on commit 1321201

Please sign in to comment.