ableegoldman commented on a change in pull request #10342:
URL: https://github.com/apache/kafka/pull/10342#discussion_r596447157



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/processor/internals/StateDirectoryTest.java
##########
@@ -152,33 +152,15 @@ private void assertPermissions(final File file) {
     @Test
     public void shouldCreateTaskStateDirectory() {
         final TaskId taskId = new TaskId(0, 0);
-        final File taskDirectory = directory.directoryForTask(taskId);
+        final File taskDirectory = 
directory.getOrCreateDirectoryForTask(taskId);
         assertTrue(taskDirectory.exists());
         assertTrue(taskDirectory.isDirectory());
     }
 
     @Test
-    public void shouldLockTaskStateDirectory() throws IOException {
+    public void shouldBeTrueIfAlreadyHoldsLock() {
         final TaskId taskId = new TaskId(0, 0);
-        final File taskDirectory = directory.directoryForTask(taskId);
-
-        directory.lock(taskId);
-
-        try (
-            final FileChannel channel = FileChannel.open(
-                new File(taskDirectory, LOCK_FILE_NAME).toPath(),
-                StandardOpenOption.CREATE, StandardOpenOption.WRITE)
-        ) {
-            assertThrows(OverlappingFileLockException.class, channel::tryLock);
-        } finally {
-            directory.unlock(taskId);
-        }
-    }
-
-    @Test
-    public void shouldBeTrueIfAlreadyHoldsLock() throws IOException {
-        final TaskId taskId = new TaskId(0, 0);
-        directory.directoryForTask(taskId);

Review comment:
       The diff here is a little weird, but essentially I just removed the 
`shouldLockTaskStateDirectory` test since it would do nothing except call 
`lock()` and `unlock()` once you take out the FileChannel stuff, and that's 
already covered by other tests




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to