Skip to content

Commit

Permalink
Fix flaky test ProducerCloseTest.brokerCloseTopicTest. (apache#16644)
Browse files Browse the repository at this point in the history
  • Loading branch information
Technoboy- authored Jul 18, 2022
1 parent 630c758 commit 888898c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.pulsar.client.api.TypedMessageBuilder;
import org.apache.pulsar.common.api.proto.CommandSuccess;
import org.apache.pulsar.common.naming.TopicName;
import org.awaitility.Awaitility;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
Expand Down Expand Up @@ -137,7 +138,7 @@ public void brokerCloseTopicTest(boolean enableBatch, boolean isAsyncSend) throw
.getTopicReference(TopicName.get(topic).getPartitionedTopicName());
Assert.assertTrue(topicOptional.isPresent());
topicOptional.get().close(true).get();
Assert.assertEquals(producer.getState(), HandlerState.State.Connecting);
Awaitility.await().untilAsserted(() -> Assert.assertEquals(producer.getState(), HandlerState.State.Connecting));
if (isAsyncSend) {
producer.newMessage().value("test".getBytes()).sendAsync().get();
} else {
Expand Down

0 comments on commit 888898c

Please sign in to comment.