filer: require the live object from the first lookup in the expiry race test

The fence check was skipped when the first lookup errored or found
nothing, so a run that took either path passed without checking
anything. The store hands that lookup its copy before the hook expires
the object, so it always returns the live object; require that, then
compare its fence against the delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-12-01 15:16:51 -08:00
1 parent 9612333343
commit 8bf659dcb6
1 file changed
+6 -1
@@ -74,8 +74,13 @@ func TestLookupFenceNotAboveAConcurrentExpiryDelete(t *testing.T) {
if _, found := store.entries[path]; found {
t.Fatal("expired object still stored")
}
// The store hands the first lookup its copy before the hook expires the
// object, so it returns the live object.
if a.err != nil || a.resp.GetEntry() == nil {
t.Fatalf("first lookup: err=%v entry=%v, want the live object", a.err, a.resp.GetEntry())
}
deletePos := fs.filer.LocalMetaLogBuffer.LastTsNs.Load()
if a.err == nil && a.resp.Entry != nil && a.resp.LogTsNs >= deletePos {
if a.resp.LogTsNs >= deletePos {
t.Fatalf("first lookup returned the object under fence %d, at or above its delete at %d", a.resp.LogTsNs, deletePos)
}
}