FrankYang0529 commented on code in PR #15568: URL: https://github.com/apache/kafka/pull/15568#discussion_r1539105595
########## core/src/test/scala/unit/kafka/raft/RaftManagerTest.scala: ########## @@ -178,7 +178,7 @@ class RaftManagerTest { } private def fileLocked(path: Path): Boolean = { - TestUtils.resource(FileChannel.open(path, StandardOpenOption.WRITE)) { channel => + TestUtils.resource(FileChannel.open(path, StandardOpenOption.CREATE, StandardOpenOption.WRITE)) { channel => Review Comment: We remove the `.lock` file when `RaftManager#shutdown`. In this case, `FileChannel` can't open a nonexistent file and will throw `NoSuchFileException`, so I add `StandardOpenOption.CREATE` to avoid the error. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org