You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ca...@apache.org on 2023/09/06 12:50:00 UTC

[kafka] branch trunk updated: MINOR: StoreChangelogReaderTest fails with log-level DEBUG (#14300)

This is an automated email from the ASF dual-hosted git repository.

cadonna pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new eb39c95080b MINOR: StoreChangelogReaderTest fails with log-level DEBUG (#14300)
eb39c95080b is described below

commit eb39c95080b994398c40bcf5d54181e713ed6faa
Author: Lucas Brutschy <lu...@users.noreply.github.com>
AuthorDate: Wed Sep 6 14:49:48 2023 +0200

    MINOR: StoreChangelogReaderTest fails with log-level DEBUG (#14300)
    
    A mocked method is executed unexpectedly when we enable DEBUG
    log level, leading to confusing test failures during debugging.
    Since the log message itself seems useful, we adapt the test
    to take the additional mocked method call into account).
    
    Reviewer: Bruno Cadonna <ca...@apache.org>
---
 .../kafka/streams/processor/internals/StoreChangelogReaderTest.java | 6 +++++-
 1 file changed, 5 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 3102094990d..2848f0dcd5e 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
@@ -520,7 +520,11 @@ public class StoreChangelogReaderTest extends EasyMockSupport {
     public void shouldRestoreFromBeginningAndCheckCompletion() {
         final TaskId taskId = new TaskId(0, 0);
 
-        EasyMock.expect(storeMetadata.offset()).andReturn(null).andReturn(9L).anyTimes();
+        if (type == STANDBY && logContext.logger(StoreChangelogReader.class).isDebugEnabled()) {
+            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);