SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix(test): retry ENOENT in fcntl lock subprocess helper
Chris Lucb882ced468b
diff --git a/test/fuse_integration/posix_file_lock_test.go b/test/fuse_integration/posix_file_lock_test.goindex 1712aa4b21..e96c0c0f92 100644--- a/test/fuse_integration/posix_file_lock_test.go+++ b/test/fuse_integration/posix_file_lock_test.go@@ -82,9 +82,25 @@ func TestFcntlLockHelper(t *testing.T) {start, _ := strconv.ParseInt(os.Getenv("LOCK_START"), 10, 64)length, _ := strconv.ParseInt(os.Getenv("LOCK_LEN"), 10, 64)- f, err := os.OpenFile(filePath, os.O_RDWR, 0)- if err != nil {- fmt.Fprintf(os.Stderr, "open: %v\n", err)+ // The parent test process created the file on the FUSE mount just before+ // spawning this subprocess. A fresh lookup from a different process can+ // briefly return ENOENT while the mount's dentry state propagates, so+ // retry on ENOENT before giving up.+ var f *os.File+ var openErr error+ for attempt := 0; attempt < 40; attempt++ {+ f, openErr = os.OpenFile(filePath, os.O_RDWR, 0)+ if openErr == nil {+ break+ }+ if !errors.Is(openErr, os.ErrNotExist) && !errors.Is(openErr, syscall.ENOENT) {+ break+ }+ _, _ = os.ReadDir(filepath.Dir(filePath))+ time.Sleep(50 * time.Millisecond)+ }+ if openErr != nil {+ fmt.Fprintf(os.Stderr, "open: %v\n", openErr)os.Exit(1)}defer f.Close()