Repository navigation
Commit 89bf8e9
test: give each test its own PredBat rather than sharing one (#5079)
Every registered test ran against a single PredBat built once at startup, so a
test that mutated instance state and did not restore it broke whichever
unrelated test happened to follow - depending only on the order they ran in.
That has produced a long series of order-dependent failures (#5079), each
previously fixed by hand-writing a snapshot/restore block naming the fields
that particular test touched.
Building the fixture per test removes the whole class instead. Measured on the
53 known-bad (culprit, victim) orderings collected so far: 53 of 53 fail before
this change, 0 of 53 after (with #5100, which fixes the one test that also
fails on its own).
The reason this was not done sooner appears to be an assumption that rebuilding
would be too slow. It is not - create_predbat() is about 22ms, and the full
suite measures 174s shared against 173s per-test, i.e. no measurable difference,
since the suite's cost is dominated by the prediction work inside the tests
rather than by fixture setup.
Also confirms the tests themselves are sound: all 316 pass when run individually
in their own process, so every ordering failure was shared-fixture contamination
rather than a test depending on an earlier one to set it up.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 45e3562 commit 89bf8e9
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| 822 | + | |
| 823 | + | |
822 | 824 | | |
823 | 825 | | |
824 | 826 | | |
| |||
897 | 899 | | |
898 | 900 | | |
899 | 901 | | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
900 | 909 | | |
901 | 910 | | |
902 | 911 | | |
| |||
0 commit comments