Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-17463][tests] Avoid concurrent directory creation and deletion
BlobCacheCleanupTest#testPermanentBlobCleanup() tests that job related files are cleaned up by a background task when the job is released from the PermanentBlobCache. The tests asserts that the uploaded blobs are deleted from the filesystem. Because the scheduling of the background task cannot be controlled from outside the cache, the test polls the filesystem. More precisely, the test uses BlobUtils#getStorageLocation() to build the path on the filesystem given a blobkey and tests the existence of that path in regular intervals. As a side effect, however, BlobUtils#getStorageLocation() also creates all necessary directories to that path if they do not exist yet. This leads to a situation where directories and concurrently deleted and created, which can cause FileAlreadyExists exceptions. This commit fixes the issue. Note that the above applies to all tests that invoke BlobServerCleanupTest#checkFilesExist(). This closes apache#12376.
- Loading branch information