The test depends on timing. The commit that moved next (ba5a716) only adds tests under internal/handlers, and the previous head c7173c47 passed. The test starts the evictor first (StartEviction(100 * time.Millisecond)). Then, for each key, it stores the variant file and inserts that file's accounting row by hand. When the evictor's reconciliation runs between those two steps, it adopts the just-stored file into variant_content first (the log shows "adopted untracked variant file into size accounting cache_key=aabbccdd0001"), and the test's own INSERT then hits the unique key.
To reproduce: clone next fresh and run script/cibuild. It fails only when the reconciliation lands in that window, so it can take several runs.
Definition of done: the test sets up its over-limit state in a way the running evictor cannot interleave with, and still proves that only the periodic schedule triggers the eviction (no weakened assertion, no retry). script/cibuild on a fresh clone of next passes.
Top priority: this comes before all other pixa work. Labelled critical: a red next blocks every merge that has to keep it green.
Model: opus-5-5
`next` is red. `script/cibuild` on a fresh clone of `next` (`ba5a7162`) fails in the `make test` step:
```
--- FAIL: TestEvictionRunsOnPeriodicSchedule (1.51s)
eviction_internal_test.go:717: failed to insert variant accounting row: constraint failed: UNIQUE constraint failed: variant_content.cache_key (1555)
```
The test depends on timing. The commit that moved `next` (`ba5a716`) only adds tests under `internal/handlers`, and the previous head `c7173c47` passed. The test starts the evictor first (`StartEviction(100 * time.Millisecond)`). Then, for each key, it stores the variant file and inserts that file's accounting row by hand. When the evictor's reconciliation runs between those two steps, it adopts the just-stored file into `variant_content` first (the log shows "adopted untracked variant file into size accounting cache_key=aabbccdd0001"), and the test's own `INSERT` then hits the unique key.
To reproduce: clone `next` fresh and run `script/cibuild`. It fails only when the reconciliation lands in that window, so it can take several runs.
Definition of done: the test sets up its over-limit state in a way the running evictor cannot interleave with, and still proves that only the periodic schedule triggers the eviction (no weakened assertion, no retry). `script/cibuild` on a fresh clone of `next` passes.
Top priority: this comes before all other pixa work. Labelled critical: a red `next` blocks every merge that has to keep it green.
Model: opus-5-5
Plan for the pixa manager (it comes before all other pixa work).
Cause, on current next: evictionLoop in internal/imgcache/eviction.go runs runReconciliationPass at startup and on every tick, and reconcileVariantFiles adopts any variant file that has no accounting row. TestEvictionRunsOnPeriodicSchedule starts the evictor with a 100 ms interval and then, for each key, calls variants.Store and inserts the variant_content row by hand as a second step. A tick between the two steps adopts the file first, and the hand insert hits the unique key.
Requirements:
The test can no longer race the evictor: same result on every run, with no sleeps used as synchronisation and no retries.
It still proves what it claims: only the periodic ticker triggers the eviction (no store method, so no write-pressure notification), usage ends at or below the limit, and no dangling references remain. No assertion is weakened or removed.
Prefer a test-only change. One direction: let the periodic reconciliation adopt the stored files instead of inserting rows by hand, if that keeps the claim intact. Touch production code only if the test cannot be made deterministic otherwise, and keep that change minimal.
Check whether any other test in internal/imgcache does the same store-then-insert after StartEviction; fix those the same way.
Done when script/cibuild on a fresh clone of the branch rebased on current next passes, the fixed test has passed repeated runs through the repo's own targets, and an independent review passes.
Model: opus-5-5
Plan for the pixa manager (it comes before all other pixa work).
Cause, on current `next`: `evictionLoop` in `internal/imgcache/eviction.go` runs `runReconciliationPass` at startup and on every tick, and `reconcileVariantFiles` adopts any variant file that has no accounting row. `TestEvictionRunsOnPeriodicSchedule` starts the evictor with a 100 ms interval and then, for each key, calls `variants.Store` and inserts the `variant_content` row by hand as a second step. A tick between the two steps adopts the file first, and the hand insert hits the unique key.
Requirements:
- The test can no longer race the evictor: same result on every run, with no sleeps used as synchronisation and no retries.
- It still proves what it claims: only the periodic ticker triggers the eviction (no store method, so no write-pressure notification), usage ends at or below the limit, and no dangling references remain. No assertion is weakened or removed.
- Prefer a test-only change. One direction: let the periodic reconciliation adopt the stored files instead of inserting rows by hand, if that keeps the claim intact. Touch production code only if the test cannot be made deterministic otherwise, and keep that change minimal.
- Check whether any other test in `internal/imgcache` does the same store-then-insert after `StartEviction`; fix those the same way.
Done when `script/cibuild` on a fresh clone of the branch rebased on current `next` passes, the fixed test has passed repeated runs through the repo's own targets, and an independent review passes.
Model: opus-5-5
#187 changes only the test. It writes the variant files, with no accounting rows, while the evictor's startup pass waits on the test database's only connection. A periodic reconciliation pass then adopts the files, and the eviction pass that follows it evicts them.
Model: opus-5-5
https://git.eeqj.de/sneak/pixa/pulls/187 changes only the test. It writes the variant files, with no accounting rows, while the evictor's startup pass waits on the test database's only connection. A periodic reconciliation pass then adopts the files, and the eviction pass that follows it evicts them.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
nextis red.script/cibuildon a fresh clone ofnext(ba5a7162) fails in themake teststep:The test depends on timing. The commit that moved
next(ba5a716) only adds tests underinternal/handlers, and the previous headc7173c47passed. The test starts the evictor first (StartEviction(100 * time.Millisecond)). Then, for each key, it stores the variant file and inserts that file's accounting row by hand. When the evictor's reconciliation runs between those two steps, it adopts the just-stored file intovariant_contentfirst (the log shows "adopted untracked variant file into size accounting cache_key=aabbccdd0001"), and the test's ownINSERTthen hits the unique key.To reproduce: clone
nextfresh and runscript/cibuild. It fails only when the reconciliation lands in that window, so it can take several runs.Definition of done: the test sets up its over-limit state in a way the running evictor cannot interleave with, and still proves that only the periodic schedule triggers the eviction (no weakened assertion, no retry).
script/cibuildon a fresh clone ofnextpasses.Top priority: this comes before all other pixa work. Labelled critical: a red
nextblocks every merge that has to keep it green.Model: opus-5-5
Plan for the pixa manager (it comes before all other pixa work).
Cause, on current
next:evictionLoopininternal/imgcache/eviction.gorunsrunReconciliationPassat startup and on every tick, andreconcileVariantFilesadopts any variant file that has no accounting row.TestEvictionRunsOnPeriodicSchedulestarts the evictor with a 100 ms interval and then, for each key, callsvariants.Storeand inserts thevariant_contentrow by hand as a second step. A tick between the two steps adopts the file first, and the hand insert hits the unique key.Requirements:
internal/imgcachedoes the same store-then-insert afterStartEviction; fix those the same way.Done when
script/cibuildon a fresh clone of the branch rebased on currentnextpasses, the fixed test has passed repeated runs through the repo's own targets, and an independent review passes.Model: opus-5-5
#187 changes only the test. It writes the variant files, with no accounting rows, while the evictor's startup pass waits on the test database's only connection. A periodic reconciliation pass then adopts the files, and the eviction pass that follows it evicts them.
Model: opus-5-5
clawbot referenced this issue2026-10-04 17:24:02 +02:00