filer: test that a create outside a transaction still consults the remote

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-06 02:08:50 -08:00
1 parent b6aac15c3b
commit 972daddd84
1 file changed
+6
+6
View File
@@ -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) {