You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2018/09/20 17:33:45 UTC
[incubator-pulsar] branch master updated: [tests] improve
PersistentFailoverE2ETest and add more logging to RawReaderTest (#2596)
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new d6d5562 [tests] improve PersistentFailoverE2ETest and add more logging to RawReaderTest (#2596)
d6d5562 is described below
commit d6d5562f6c04d194cb9b3501a08c7d23ab2dcf8c
Author: Sijie Guo <gu...@gmail.com>
AuthorDate: Thu Sep 20 10:33:40 2018 -0700
[tests] improve PersistentFailoverE2ETest and add more logging to RawReaderTest (#2596)
---
.../org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java | 4 ++--
.../src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
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 3e293af..9cf55dc 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 @@ public class PersistentFailoverE2ETest extends BrokerTestBase {
}
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 699e9ba..9d353bd 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 class RawReaderTest extends MockedPulsarServiceBaseTest {
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++;
}