Browse Source

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 <cadonna@apache.org>
pull/14350/head
Lucas Brutschy 1 year ago committed by GitHub
parent
commit
eb39c95080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java

6
streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java

@ -520,7 +520,11 @@ public class StoreChangelogReaderTest extends EasyMockSupport { @@ -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);

Loading…
Cancel
Save