Repository navigation
Commit 16b91c8
#330 storage-embedding-measurements cap test: the eviction-boundary test
inserted MEASUREMENT_CORPUS_SESSION_ROW_CAP + 5 = 2005 disk-backed rows with
no declared timeout, so its verdict was a function of machine speed against
bun's default 5s per-test budget. Make the cap injectable via an optional
parameter on recordEmbeddingMeasurement (defaulting to the production 2000)
and exercise the boundary at cap=25. The invariant under test — "keeps the
newest rows when the cap is exceeded" — is scale-independent, so a small cap
proves it in ~90ms instead of ~7s and removes the hardware dependence
entirely rather than raising the ceiling above it.
#333 message-index-async boot-quiet test: the "rebuilds when removal overtakes
a boot-quiet reconciliation" test asserted behavior inside a fixed 80ms
wall-clock await, so under CI load the race window (a ~20ms boot-quiet timer,
two scheduling hops, and two DB cycles) didn't close in time and the verdict
flipped on timing rather than behavior. Replace the fixed await with the
existing waitUntil() helper polling the observable outcome (reads === 2 AND
isSessionReconciled) with a generous 5s ceiling — the assertion now waits FOR
the state, not FOR a duration.
Both fixes verified to still bite on real regressions:
- #330: disabling the overflow DELETE makes the test fail (rows.length != cap).
- #333: removing the clear-and-reindex rebuild makes the test time out waiting
for the reconciled state.
- #333 race confirmed: with boot-quiet expiring at ~100ms (after the old 80ms
budget), the original wait(80) fails; the waitUntil version passes under the
same shrunk window, proving the fix waits for state, not duration.
Co-Authored-By: Alfonso <[email protected]>
1 parent 72456d3 commit 16b91c8
3 files changed
Lines changed: 20 additions & 6 deletions
File tree
- packages/plugin/src/features/magic-context
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
87 | | - | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | | - | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
0 commit comments