From 972daddd849e3c5138a9a5fb1590ce64979e1c09 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 6 Nov 2026 02:08:50 -0800 Subject: [PATCH] filer: test that a create outside a transaction still consults the remote Co-Authored-By: Claude Opus 5.5 --- weed/filer/filer_lazy_remote_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/weed/filer/filer_lazy_remote_test.go b/weed/filer/filer_lazy_remote_test.go index e5dca2bd5b..64f1d78ced 100644 --- a/weed/filer/filer_lazy_remote_test.go +++ b/weed/filer/filer_lazy_remote_test.go @@ -768,6 +768,12 @@ func TestCreateEntry_SkipsTheLazyFetchInsideAStoreTransaction(t *testing.T) { excl := &Entry{FullPath: "/buckets/mybucket/dir/c.txt", Attr: Attr{Mode: 0644, Mtime: time.Now(), Crtime: time.Now()}} err = f.CreateEntry(txCtx, excl, nil, true, false, nil, false, f.MaxFilenameLength) assert.ErrorIs(t, err, filer_pb.ErrEntryAlreadyExists) + + // outside a transaction a create still consults the remote + statCalls := countingStub.statCalls + plain := &Entry{FullPath: "/buckets/mybucket/dir/d.txt", Attr: Attr{Mode: 0644, Mtime: time.Now(), Crtime: time.Now()}} + require.NoError(t, f.CreateEntry(context.Background(), plain, nil, false, false, nil, false, f.MaxFilenameLength)) + assert.Greater(t, countingStub.statCalls, statCalls) } func TestMaybeLazyFetchFromRemote_GuardedClientRejectsEndpoint(t *testing.T) {