robinrvm commented on code in PR #29647:
URL: https://github.com/apache/flink/pull/29647#discussion_r4410444832
##########
flink-runtime/src/test/java/org/apache/flink/runtime/blob/TestingBlobHelpers.java:
##########
@@ -207,6 +207,41 @@ public static void checkFileCountForApplication(
applicationDir =
cache.getStorageLocation(applicationId, new
PermanentBlobKey()).getParentFile();
}
+ checkFileCountInApplicationDir(expectedCount, applicationDir);
+ }
+
+ /**
+ * Checks the number of files in the blob service for the given
application, like {@link
+ * #checkFileCountForApplication(int, ApplicationID,
PermanentBlobService)}, but without
+ * creating the application directory.
+ *
+ * <p>Use this while a cleanup task may concurrently delete the
application directory: creating
+ * the directory at the same time can fail with a {@link
+ * java.nio.file.FileAlreadyExistsException}.
+ *
+ * @param expectedCount number of expected files in the blob service for
the given application
+ * @param applicationId ID of an application
+ * @param blobService BLOB store to use
+ */
+ public static void checkFileCountForApplicationWithoutCreatingDirectory(
Review Comment:
Thank you @MartijnVisser for the review! addressed review comments.
- `checkFileCountForApplication` no longer creates the directory, and the
extra helper is gone. `BlobLibraryCacheManagerTest` is unchanged now.
- `checkFileCountForJob` gets the same change, which covers
`BlobCacheCleanupTest#verifyJobCleanup`.
- Added the Generated-by trailer to the commit.
- Both helpers now build the directory path with
BlobUtils.getStorageLocationPath (same path as before) instead of
getStorageLocation, so the check never creates the directory while the cleanup
task deletes it.
- Flink CI (beta) on commit id `94500d4`:
https://github.com/robinrvm/flink/actions/runs/40838864747
- The 4 test classes that use these helpers (`BlobCacheCleanupTest`,
`BlobServerCleanupTest`, `BlobServerDeleteTest`,
`BlobLibraryCacheManagerTest`), 100 runs on master (eead57e) and 100 runs with
this change (94500d4), on the current CI image, 0 failures:
https://github.com/robinrvm/flink/actions/runs/40841818044
--
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]