Commit aea7e9c
authored
test(decay): deflake reinforced-memory guard against coarse clocks (#190)
The test simulated reinforcement by setting last_access = now_ts(), then
asserted the next decay pass leaves stability bit-identical (1e-9). On
hosts with coarse clock resolution (observed on Windows: consecutive
time.time() calls can return the same value), last_access can equal the
just-written last_decay anchor, so the strict 'last_access > anchor'
guard misses and the pass legitimately decays one tick's interval
(~2.1e-9 stability drift) — a race, not the compounding regression this
test pins.
Set last_access one second past the pass anchor so the guard condition
holds deterministically on every host, and extend coverage to 50 rapid
passes to pin the guard, not just the first one after the update.
Reproduced: full-suite runs failed this test intermittently (stability
drift 2.13e-9 vs 1e-9 threshold) while it passed in isolation; 20/20
same-tick stress trials now stable across 8 consecutive test runs.1 parent a7a9fe4 commit aea7e9c
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | | - | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments