vfs: retry finding the object in the test which checks modtime support

canSetModTime looked up the object it had just written without any
retries, so on backends with read-after-write lag such as Internxt the
lookup failed. As the result is only worked out once, the remaining
TestFileSetModTime subtests then ran assuming the modtime could be set.
This commit is contained in:
Nick Craig-Wood committed 2026-10-29 15:11:33 +00:00
1 parent 7935d517fb
commit 94319c360b
1 file changed
+2 -3
+2 -3
View File
@@ -337,10 +337,9 @@ func canSetModTime(t *testing.T, r *fstest.Run) bool {
canSetModTimeOnce.Do(func() {
mtime1 := time.Date(2008, time.November, 18, 17, 32, 31, 0, time.UTC)
_ = r.WriteObject(context.Background(), "time_test", "stuff", mtime1)
obj, err := r.Fremote.NewObject(context.Background(), "time_test")
require.NoError(t, err)
obj := fstest.NewObject(context.Background(), t, r.Fremote, "time_test")
mtime2 := time.Date(2009, time.November, 18, 17, 32, 31, 0, time.UTC)
err = obj.SetModTime(context.Background(), mtime2)
err := obj.SetModTime(context.Background(), mtime2)
switch err {
case nil:
canSetModTimeValue = true