Commit bff54c5
fix(integration): log fuzz seed so failures can be reproduced (#7552)
Adds a newFuzzRand(t *testing.T) *rand.Rand helper that logs the random
seed every fuzz test draws (via t.Logf), and replaces 13 ad-hoc
rand.New(rand.NewSource(time.Now().Unix())) call sites across
integration/query_fuzz_test.go (11 sites) and
integration/parquet_querier_test.go (2 sites) with calls to it. A
FUZZ_SEED environment variable overrides the default time-based seed so
a failing CI run can be replayed locally byte-for-byte.
This is a pure observability change. It does not fix the underlying
TestProtobufCodecFuzz flake tracked in #7548 -- it makes the next
failure classifiable. The current code silently consumes the seed via
rand.New(rand.NewSource(now.Unix())) and never surfaces it in the test
log, so the failing query/series combination cannot be regenerated and
every failure has to be diagnosed from the comparison output alone.
That is insufficient to distinguish real Cortex/Prometheus divergence
from known-class non-determinism from infra noise. Logging the seed
(and accepting an override) is the minimum surface needed to make the
next failure reproducible.
Invalid FUZZ_SEED values are logged rather than silently falling back,
so a typo in CI configuration surfaces immediately instead of
masquerading as a successful override.
The helper is applied to all 13 fuzz call sites, not just
TestProtobufCodecFuzz, because the underlying observability gap is
identical for every fuzz test in the integration suite and applying
the helper everywhere is strictly less code than leaving twelve other
tests with the same gap.
This is the final PR in a four-PR series filed against issues
#7545-#7548, complementing PR #7544 (which fixes #7543).
Fixes #7548
Signed-off-by: Sandy Chen <ychen@monoidtech.com>
Signed-off-by: Sandy Chen <Yuxuan.Chen@morganstanley.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e912988 commit bff54c5
2 files changed
Lines changed: 31 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
241 | 240 | | |
242 | 241 | | |
243 | 242 | | |
244 | | - | |
| 243 | + | |
245 | 244 | | |
246 | 245 | | |
247 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
| 773 | + | |
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
1208 | | - | |
| 1208 | + | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| |||
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
1363 | | - | |
| 1363 | + | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
1596 | | - | |
| 1596 | + | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | 1599 | | |
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
| |||
1819 | 1819 | | |
1820 | 1820 | | |
1821 | 1821 | | |
1822 | | - | |
1823 | | - | |
| 1822 | + | |
1824 | 1823 | | |
1825 | 1824 | | |
1826 | 1825 | | |
| |||
1983 | 1982 | | |
1984 | 1983 | | |
1985 | 1984 | | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
1986 | 2003 | | |
1987 | 2004 | | |
1988 | 2005 | | |
| |||
0 commit comments