Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.abort;
import static org.mockito.Mockito.anyList;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -147,12 +148,17 @@ public static boolean isFileNotInUse(String filePath) {
}
LOG.debug("File is in use: {}", filePath);
return false;
} catch (IOException e) {
LOG.warn("Failed to check if file is in use: {}", filePath, e);
return false; // On failure, assume the file is in use
} finally {
process.destroy();
}
} catch (IOException e) {
// if process cannot be started, skip the test
LOG.warn("Failed to check if file is in use: {}", filePath, e);
return false; // On failure, assume the file is in use
abort(e.getMessage());
return false; // unreachable, abort() throws exception
}
}

Expand Down