clolov commented on code in PR #14716:
URL: https://github.com/apache/kafka/pull/14716#discussion_r1577406177
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java:
##########
@@ -293,17 +288,12 @@ public void cleanup() throws IOException {
task = null;
}
Utils.delete(BASE_DIR);
- mockito.finishMocking();
}
@Test
- public void shouldThrowLockExceptionIfFailedToLockStateDirectory() throws
IOException {
- stateDirectory = EasyMock.createNiceMock(StateDirectory.class);
- EasyMock.expect(stateDirectory.lock(taskId)).andReturn(false);
-
EasyMock.expect(stateManager.changelogPartitions()).andReturn(Collections.emptySet());
- stateManager.registerStore(stateStore,
stateStore.stateRestoreCallback, null);
- EasyMock.expectLastCall();
- EasyMock.replay(stateDirectory, stateManager);
+ public void shouldThrowLockExceptionIfFailedToLockStateDirectory() {
+ stateDirectory = mock(StateDirectory.class);
Review Comment:
Heya @cadonna! I had another pass. The problem here is that the tests which
appear to be properly using the state directory don't actually lock it. This
means that when I try to close it I get the error above. As such, I decided to
explicitly lock the state directory during setup (added the call + explanation
to the setup method). Let me know if you disagree with this approach!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]