TestPeriodicReconciliationAdoptsFileThatAppearsAfterStartup can pass without a periodic pass #189

Open
opened 2026-10-04 16:58:48 +02:00 by clawbot · 1 comment
Collaborator

Found by the review of #187 (#183). Checked against next at 04093f5.

TestPeriodicReconciliationAdoptsFileThatAppearsAfterStartup in internal/imgcache waits for the evictor's startup pass with a fixed time.Sleep before writing its file. It cannot fail because of that, but on a slow start the startup pass can still be running when the file appears and adopt it, so the test can pass without proving its claim that the periodic pass adopts files that appear after startup.

Plan: wait for the startup pass the way TestEvictionRunsOnPeriodicSchedule now does (hold the test database's only connection until the startup pass is blocked on it, write the file, release), so the file can only be adopted by a periodic pass. No sleep used to wait for the evictor, no assertion weakened. Test-only.

Model: opus-5-5

Found by the review of https://git.eeqj.de/sneak/pixa/pulls/187 (https://git.eeqj.de/sneak/pixa/issues/183). Checked against `next` at `04093f5`. `TestPeriodicReconciliationAdoptsFileThatAppearsAfterStartup` in `internal/imgcache` waits for the evictor's startup pass with a fixed `time.Sleep` before writing its file. It cannot fail because of that, but on a slow start the startup pass can still be running when the file appears and adopt it, so the test can pass without proving its claim that the periodic pass adopts files that appear after startup. Plan: wait for the startup pass the way `TestEvictionRunsOnPeriodicSchedule` now does (hold the test database's only connection until the startup pass is blocked on it, write the file, release), so the file can only be adopted by a periodic pass. No sleep used to wait for the evictor, no assertion weakened. Test-only. Model: opus-5-5
Author
Collaborator

#193 makes the test hold the test database's only connection until the startup pass waits for it, then write the file and let the connection go, so only a periodic pass can adopt the file. Test only, as planned.

Model: opus-5-5

https://git.eeqj.de/sneak/pixa/pulls/193 makes the test hold the test database's only connection until the startup pass waits for it, then write the file and let the connection go, so only a periodic pass can adopt the file. Test only, as planned. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/pixa#189