lhotari commented on a change in pull request #9356:
URL: https://github.com/apache/pulsar/pull/9356#discussion_r565975489
##########
File path:
pulsar-io/rabbitmq/src/test/java/org/apache/pulsar/io/rabbitmq/sink/RabbitMQSinkTest.java
##########
@@ -65,7 +66,15 @@ public void TestOpenAndWriteSink() throws Exception {
RabbitMQSink sink = new RabbitMQSink();
// open should success
- sink.open(configs, null);
+ // rabbitmq service may need time to initialize
+ Awaitility.await().atMost(Duration.ofSeconds(5)).until(() -> {
+ try {
+ sink.open(configs, null);
+ return true;
Review comment:
One way to make the code cleaner is to use `.untilAsserted` that can be
used for code that isn't expected to throw exceptions.
I'd also recommend omitting `atMost(Duration.ofSeconds(5))` part. The
default is 10 seconds by default and that should be fine
Something like:
`Awaitility.await().untilAsserted(() -> sink.open(configs, null));`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]