Commit 2a98faf
fix(integration): repair TestExpandedPostingsCacheFuzz latent bugs (#7549)
TestExpandedPostingsCacheFuzz had two independent defects that together
neutered the test:
1. The query-generation loop at integration/query_fuzz_test.go:550-557
was inverted: `break` fired the moment isValidQuery returned true,
exiting the outer `for i` loop, and only *invalid* expressions ever
reached the append. The queries/matchers slices ended up holding at
most testRun invalid exprs (or empty if the first draw was valid).
Every downstream c1.Query / c1.QueryRange call then short-circuited
with the same error on both clients, so cmp.Equal(err1, err2)
trivially held and nothing was actually compared.
2. The Series diff branch at integration/query_fuzz_test.go:657 read
`cmp.Equal(tc.sres1, tc.sres1, ...)` — self-comparison — so the
Series API divergence check was dead code.
Net effect: the test had been a no-op for divergences. Issue #7545
captures the empirical census.
Fix: wrap the WalkRangeQuery call in a nested `for { ... }` that
re-draws until isValidQuery is satisfied, mirroring the sibling fuzz
tests in this file, and change `tc.sres1, tc.sres1` to
`tc.sres1, tc.sres2`. No production code touched; enabledAggrs is
already wired in.
Two follow-ups worth flagging honestly: wall-clock will grow
substantially (the previously-skipped ~9k HTTP round-trips now
actually run), and any genuine v1.18.0-vs-HEAD divergence in the
expanded-postings-cache code path will now surface as a real failure
for the first time, to be triaged as a real bug rather than a
regression from this PR.
Fixes #7545
Signed-off-by: Sandy Chen <Yuxuan.Chen@morganstanley.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 76947fd commit 2a98faf
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
554 | | - | |
555 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
556 | 559 | | |
557 | 560 | | |
558 | 561 | | |
| |||
651 | 654 | | |
652 | 655 | | |
653 | 656 | | |
654 | | - | |
| 657 | + | |
655 | 658 | | |
656 | 659 | | |
657 | 660 | | |
| |||
0 commit comments