maedhroz commented on code in PR #3253:
URL: https://github.com/apache/cassandra/pull/3253#discussion_r1571281239
##########
test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java:
##########
@@ -1359,23 +1367,62 @@ static Set<File> getFinalFiles(File folder)
return listFiles(folder, Directories.FileType.FINAL);
}
+ // Used by listFiles - this test is deliberately racing with files being
+ // removed and cleaned up, so it is possible that files are removed
between listing and getting their
+ // canonical names, in which case they can be dropped from the stream.
+ private static Stream<File> toCanonicalIgnoringNotFound(File file)
+ {
+ try
+ {
+ return Stream.of(file.getCanonicalFile());
+ }
+ catch (IOException io)
+ {
+ if (Throwables.isCausedBy(io, t -> t instanceof
NoSuchFileException))
+ {
+ return Stream.empty();
+ }
+ else
+ {
+ throw new RuntimeException(io);
Review Comment:
```suggestion
throw new UncheckedIOException(io);
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]