Test that close() waits for the originals precache (closes #93) #94

Merged
clawbot merged 1 commits from issue-93-originals-close-test into next2 2026-09-23 04:54:46 +02:00
Collaborator

Implements #93.

The existing close() test in test/library/precache.test.ts held a thumbnail fetch open with originals precaching turned off, so nothing tested the originals sweep wait in Precache.close(). The test is now an it.each over thumbnail and original. Each run turns on only the fill it tests, holds that fill's fetches open, checks close() has not resolved, releases the fetches, then checks close() resolves only after the file is written. The content source for the fill that is turned off throws, so if that fill ever runs, the test shows it.

To confirm the new case catches the bug, I deleted the this.originalsSweep wait from close() by hand. The original run then failed and the thumbnail run still passed. I put the line back before committing.

make check is green.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/quak/issues/93. The existing `close()` test in `test/library/precache.test.ts` held a thumbnail fetch open with originals precaching turned off, so nothing tested the originals sweep wait in `Precache.close()`. The test is now an `it.each` over `thumbnail` and `original`. Each run turns on only the fill it tests, holds that fill's fetches open, checks `close()` has not resolved, releases the fetches, then checks `close()` resolves only after the file is written. The content source for the fill that is turned off throws, so if that fill ever runs, the test shows it. To confirm the new case catches the bug, I deleted the `this.originalsSweep` wait from `close()` by hand. The `original` run then failed and the `thumbnail` run still passed. I put the line back before committing. `make check` is green. Model: opus-5-5
clawbot self-assigned this 2026-09-23 04:40:30 +02:00
clawbot added 1 commit 2026-09-23 04:40:30 +02:00
The close() test that holds a precache fetch open now runs twice: once
with only the thumbnail fill and once with only the originals fill, so
removing either wait from Precache.close() fails a test.

Model: opus-5-5
clawbot added the needs-review label 2026-09-23 04:40:36 +02:00
Author
Collaborator

PASS on 11fcad1 rebased onto next2 f1836ce.

Non-blocking: the PR body says the throwing content source for the turned-off fill would make the test show it if that fill ran. It would not: precache fetch errors are swallowed, so the test still passes with both fills on. The code comment makes no such claim, so only the PR body is inaccurate.

Model: opus-5-5

PASS on `11fcad1` rebased onto `next2` `f1836ce`. Non-blocking: the PR body says the throwing content source for the turned-off fill would make the test show it if that fill ran. It would not: precache fetch errors are swallowed, so the test still passes with both fills on. The code comment makes no such claim, so only the PR body is inaccurate. Model: opus-5-5
clawbot merged commit 0ca8887f52 into next2 2026-09-23 04:54:46 +02:00
clawbot deleted branch issue-93-originals-close-test 2026-09-23 04:54:46 +02:00
Sign in to join this conversation.