From 02c5de2778ea697e07f78b1aa1cb09254ecf14d5 Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Sat, 19 Nov 2022 12:14:07 +0000 Subject: [PATCH 1/2] chore: increase streams tests log level to debug --- streams/src/test/resources/log4j.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streams/src/test/resources/log4j.properties b/streams/src/test/resources/log4j.properties index b7e1fb2d60ea..c3f42a7c3ecc 100644 --- a/streams/src/test/resources/log4j.properties +++ b/streams/src/test/resources/log4j.properties @@ -27,7 +27,7 @@ log4j.logger.org.apache.kafka.clients=ERROR # These are the only logs we will likely ever find anything useful in to debug Streams test failures log4j.logger.org.apache.kafka.clients.consumer=INFO log4j.logger.org.apache.kafka.clients.producer=INFO -log4j.logger.org.apache.kafka.streams=INFO +log4j.logger.org.apache.kafka.streams=DEBUG # printing out the configs takes up a huge amount of the allotted characters, # and provides little value as we can always figure out the test configs without the logs From 042d3dcb223584b05c2c56faecae982c8768c673 Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Sat, 19 Nov 2022 12:14:46 +0000 Subject: [PATCH 2/2] fix: mock to handle additional offset when standby --- .../processor/internals/StoreChangelogReaderTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java index fbd0db99a0dc..8f4d6b85df39 100644 --- a/streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java @@ -396,7 +396,12 @@ public void shouldRestoreFromPositionAndCheckForCompletion() { public void shouldRestoreFromBeginningAndCheckCompletion() { final TaskId taskId = new TaskId(0, 0); - EasyMock.expect(storeMetadata.offset()).andReturn(null).andReturn(9L).anyTimes(); + // adding another null return to handle debug log where offset is printed. + if (type == STANDBY) { + EasyMock.expect(storeMetadata.offset()).andReturn(null).andReturn(null).andReturn(9L).anyTimes(); + } else { + EasyMock.expect(storeMetadata.offset()).andReturn(null).andReturn(9L).anyTimes(); + } EasyMock.expect(stateManager.changelogOffsets()).andReturn(singletonMap(tp, 5L)); EasyMock.expect(stateManager.taskId()).andReturn(taskId).anyTimes(); EasyMock.replay(stateManager, storeMetadata, store);