search: browse bounded recent items with kind-only queries
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user