Make next green: the download-albums example test fails on a disk with under 50 GiB free #160

Closed
opened 2026-10-03 14:29:09 +02:00 by clawbot · 2 comments
Collaborator

What goes wrong

Every CI run on next since d788c54 (2026-10-02) fails one test, and so does every branch cut from next since then:

test/examples/download-albums.test.ts › "downloads every album's photos with their metadata, and on a second run only what the account gained" fails at line 177, expect(calls).toBe(3): it gets 4.

The commits that went red do not touch this test or the code under it. The same tree passes on a machine with terabytes free.

Why

The test opens its libraries with Library.open and leaves freeBelowBytes at its default of 50 GiB, so the content cache asks the real statfs how much space the volume has. In src/library/content.ts, originalsLimit is used + free - freeBelowBytes, clamped at zero. On a volume with under 50 GiB free that limit is 0. Photo 1's original, which the test puts in the cache first, is then evicted, and photo.download() fetches it again instead of copying it from the cache: a fourth fetch. The runner's volume has dropped under 50 GiB free; the test depends on the free space of whatever machine runs it.

The 50 GiB reserve is sneak's ruling on #36 and stays as it is. Only the tests change.

What to do

  • In test/examples/download-albums.test.ts, open both libraries with freeBelowBytes: 0, with a one-line comment saying why: the test counts fetches, so the host's free space must not shrink the cache.
  • Read every other test that opens a Library or a content cache without a stand-in statfs and without freeBelowBytes: 0. Where its result would change if the volume had under 50 GiB free (an original evicted, a fetch counted, a path expected in the cache), give it the same fix. Leave the eviction tests that already pass their own statfs alone.
  • No change to src/.

Definition of done

  • No test result depends on the free space of the volume it runs on.
  • The PR's own CI run passes (it runs on the same runner that fails now), and make check passes.
  • PR targets next; landing commit title ends (closes #N).

Model: opus-5-5

## What goes wrong Every CI run on `next` since `d788c54` (2026-10-02) fails one test, and so does every branch cut from `next` since then: `test/examples/download-albums.test.ts` › "downloads every album's photos with their metadata, and on a second run only what the account gained" fails at line 177, `expect(calls).toBe(3)`: it gets 4. The commits that went red do not touch this test or the code under it. The same tree passes on a machine with terabytes free. ## Why The test opens its libraries with `Library.open` and leaves `freeBelowBytes` at its default of 50 GiB, so the content cache asks the real `statfs` how much space the volume has. In `src/library/content.ts`, `originalsLimit` is `used + free - freeBelowBytes`, clamped at zero. On a volume with under 50 GiB free that limit is 0. Photo 1's original, which the test puts in the cache first, is then evicted, and `photo.download()` fetches it again instead of copying it from the cache: a fourth fetch. The runner's volume has dropped under 50 GiB free; the test depends on the free space of whatever machine runs it. The 50 GiB reserve is sneak's ruling on https://git.eeqj.de/sneak/quak/issues/36 and stays as it is. Only the tests change. ## What to do - In `test/examples/download-albums.test.ts`, open both libraries with `freeBelowBytes: 0`, with a one-line comment saying why: the test counts fetches, so the host's free space must not shrink the cache. - Read every other test that opens a `Library` or a content cache without a stand-in `statfs` and without `freeBelowBytes: 0`. Where its result would change if the volume had under 50 GiB free (an original evicted, a fetch counted, a path expected in the cache), give it the same fix. Leave the eviction tests that already pass their own `statfs` alone. - No change to `src/`. ## Definition of done - No test result depends on the free space of the volume it runs on. - The PR's own CI run passes (it runs on the same runner that fails now), and `make check` passes. - PR targets `next`; landing commit title ends ` (closes #N)`. Model: opus-5-5
clawbot added the critical label 2026-10-03 14:29:09 +02:00
Author
Collaborator

Labelled critical: next fails CI on every run because one test depends on the runner's free disk space, which keeps every next change and the milestone PR to main from passing its checks.

Model: opus-5-5

Labelled critical: `next` fails CI on every run because one test depends on the runner's free disk space, which keeps every `next` change and the milestone PR to `main` from passing its checks. Model: opus-5-5
Author
Collaborator

Built in #161: the download-albums example test opens both of its libraries with freeBelowBytes: 0, with a comment saying why. I read every other test that opens a library or content cache with the real free space, and none of their results depend on it, so they are unchanged. Nothing under src/ changed.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/quak/pulls/161: the download-albums example test opens both of its libraries with `freeBelowBytes: 0`, with a comment saying why. I read every other test that opens a library or content cache with the real free space, and none of their results depend on it, so they are unchanged. Nothing under `src/` changed. Model: opus-5-5
Sign in to join this conversation.