mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
tests: Fix sporadic failure of TestXLStorageDeleteFile (#14911)
The test expects from DeleteFile to return errDiskNotFound when the disk is not available. It calls os.RemoveAll() to remove one disk after XL storage initialization. However, this latter contains some goroutines which can race with os.RemoveAll() and then the test fails sporadically with returning random errors. The commit will tweak the initialization routine of the XL storage to only run deletion of temporary and metacache data in the background, so TestXLStorageDeleteFile won't fail anymore.
This commit is contained in:
@@ -70,7 +70,7 @@ var printEndpointError = func() func(Endpoint, error, bool) {
|
||||
}()
|
||||
|
||||
// Cleans up tmp directory of the local disk.
|
||||
func formatErasureCleanupTmp(diskPath string) {
|
||||
func bgFormatErasureCleanupTmp(diskPath string) {
|
||||
// Need to move temporary objects left behind from previous run of minio
|
||||
// server to a unique directory under `minioMetaTmpBucket-old` to clean
|
||||
// up `minioMetaTmpBucket` for the current run.
|
||||
@@ -98,9 +98,8 @@ func formatErasureCleanupTmp(diskPath string) {
|
||||
}
|
||||
|
||||
go removeAll(tmpOld)
|
||||
|
||||
// Renames and schedules for purging all bucket metacache.
|
||||
renameAllBucketMetacache(diskPath)
|
||||
go renameAllBucketMetacache(diskPath)
|
||||
}
|
||||
|
||||
// Following error message is added to fix a regression in release
|
||||
|
||||
Reference in New Issue
Block a user