Skip to content

Commit

Permalink
[tests] improve PersistentFailoverE2ETest and add more logging to Raw…
Browse files Browse the repository at this point in the history
…ReaderTest (apache#2596)
  • Loading branch information
sijie authored Sep 20, 2018
1 parent 0ab2325 commit d6d5562
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit d6d5562

Please sign in to comment.