search: browse bounded recent items with kind-only queries

This commit is contained in:
2026-10-20 17:54:00 +01:00
parent cce7ea903a
commit 9cdfd9d9ab
12 changed files with 477 additions and 94 deletions
+8
View File
@@ -538,6 +538,10 @@ func TestSearchScanBoundTruncates(t *testing.T) {
t.Fatalf("scan passed the bound and matched: %+v", hit.Field)
}
}
recent, err := store.Search(ctx, protocol.SearchRequest{Kind: protocol.SearchKindField}, time.Now())
if err != nil || !recent.Truncated || len(recent.Results) != 0 || recent.ScannedBytes > protocol.SearchMaxScanBytes {
t.Fatalf("kind-only fields bypassed the byte budget: %+v %v", recent, err)
}
}
// TestSearchScanBoundTruncatesByRowCount proves the step-count bound is
@@ -584,6 +588,10 @@ func TestSearchScanBoundTruncatesByRowCount(t *testing.T) {
if response.ScannedBytes > protocol.SearchMaxScanBytes {
t.Fatalf("scanned_bytes=%d exceeds bound %d", response.ScannedBytes, protocol.SearchMaxScanBytes)
}
recent, err := store.Search(ctx, protocol.SearchRequest{Kind: protocol.SearchKindField}, time.Now())
if err != nil || !recent.Truncated || recent.ScannedSteps != protocol.SearchMaxScanSteps {
t.Fatalf("kind-only fields bypassed the step budget: %+v %v", recent, err)
}
}
func setCreated(t *testing.T, store *Store, runID int64, timestamp string) {