sijie closed pull request #2596: [tests] improve PersistentFailoverE2ETest and
add more logging to RawReaderTest
URL: https://github.com/apache/incubator-pulsar/pull/2596
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
index 3e293afc61..9cf55dca5e 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
@@ -100,14 +100,14 @@ private void
verifyConsumerNotReceiveAnyStateChanges(TestConsumerStateEventListe
}
private void verifyConsumerActive(TestConsumerStateEventListener listener,
int partitionId) throws Exception {
- Integer pid = listener.activeQueue.poll(10, TimeUnit.SECONDS);
+ Integer pid = listener.activeQueue.take();
assertNotNull(pid);
assertEquals(partitionId, pid.intValue());
assertNull(listener.inActiveQueue.poll());
}
private void verifyConsumerInactive(TestConsumerStateEventListener
listener, int partitionId) throws Exception {
- Integer pid = listener.inActiveQueue.poll(10, TimeUnit.SECONDS);
+ Integer pid = listener.inActiveQueue.take();
assertNotNull(pid);
assertEquals(partitionId, pid.intValue());
assertNull(listener.activeQueue.poll());
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
index 699e9baae6..9d353bdaee 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
@@ -221,7 +221,10 @@ public void testFlowControl() throws Exception {
for (Future<RawMessage> f : futures) {
try (RawMessage m = f.get(1, TimeUnit.SECONDS)) {
// Assert each key is unique
- Assert.assertTrue(keys.add(extractKey(m)));
+ String key = extractKey(m);
+ Assert.assertTrue(
+ keys.add(key),
+ "Received duplicated key '" + key + "' : already received
keys = " + keys);
} catch (TimeoutException te) {
timeouts++;
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services