You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/18 18:50:22 UTC
[GitHub] [pulsar] aahmed-se opened a new pull request #9965: Harden RawReaderTest with Awaitility
aahmed-se opened a new pull request #9965:
URL: https://github.com/apache/pulsar/pull/9965
--
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:
users@infra.apache.org
[GitHub] [pulsar] aahmed-se merged pull request #9965: Harden RawReaderTest with Awaitility
Posted by GitBox <gi...@apache.org>.
aahmed-se merged pull request #9965:
URL: https://github.com/apache/pulsar/pull/9965
--
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:
users@infra.apache.org
[GitHub] [pulsar] aahmed-se commented on a change in pull request #9965: Harden RawReaderTest with Awaitility
Posted by GitBox <gi...@apache.org>.
aahmed-se commented on a change in pull request #9965:
URL: https://github.com/apache/pulsar/pull/9965#discussion_r597197327
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
##########
@@ -357,14 +359,14 @@ public void testAcknowledgeWithProperties() throws Exception {
PersistentTopic topicRef = (PersistentTopic) pulsar.getBrokerService().getTopicReference(topic).get();
ManagedLedger ledger = topicRef.getManagedLedger();
- for (int i = 0; i < 30; i++) {
- if (ledger.openCursor(subscription).getProperties().get("foobar").equals(0xdeadbeefdecaL)) {
- break;
- }
- Thread.sleep(100);
- }
- Assert.assertEquals(ledger.openCursor(subscription).getProperties().get("foobar"),
- Long.valueOf(0xdeadbeefdecaL));
+
+ Awaitility.await()
+ .atMost(5, TimeUnit.SECONDS)
+ .untilAsserted(() ->
Review comment:
The exceptions that I am concerned about are being handled by default.
--
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:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #9965: Harden RawReaderTest with Awaitility
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #9965:
URL: https://github.com/apache/pulsar/pull/9965#discussion_r597187494
##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
##########
@@ -357,14 +359,14 @@ public void testAcknowledgeWithProperties() throws Exception {
PersistentTopic topicRef = (PersistentTopic) pulsar.getBrokerService().getTopicReference(topic).get();
ManagedLedger ledger = topicRef.getManagedLedger();
- for (int i = 0; i < 30; i++) {
- if (ledger.openCursor(subscription).getProperties().get("foobar").equals(0xdeadbeefdecaL)) {
- break;
- }
- Thread.sleep(100);
- }
- Assert.assertEquals(ledger.openCursor(subscription).getProperties().get("foobar"),
- Long.valueOf(0xdeadbeefdecaL));
+
+ Awaitility.await()
+ .atMost(5, TimeUnit.SECONDS)
+ .untilAsserted(() ->
Review comment:
sometimes, it might be necessary to also add [`.ignoreExceptions()`](https://javadoc.io/doc/org.awaitility/awaitility/latest/org/awaitility/core/ConditionFactory.html#ignoreExceptions--) . Perhaps that would be useful if there's a chance that `ledger.openCursor(subscription).getProperties().get("foobar")` throws an exception?
By default, Awaitility will only retry by catching java.lang.AssertionErrors.
--
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:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on pull request #9965: Harden RawReaderTest with Awaitility
Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #9965:
URL: https://github.com/apache/pulsar/pull/9965#issuecomment-802290435
We can merge as soon as CI is green
--
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:
users@infra.apache.org