Fix two intermittently failing library tests #90

Closed
opened 2026-09-23 03:14:57 +02:00 by clawbot · 1 comment
Collaborator

Two tests failed once during reviews and passed on rerun. A gate that sometimes fails can hide a real failure or block a merge that should go through.

  • test/library/precache.test.ts, "starts both precaches from open() and reports them in status()". Reported on #86.
  • test/library/library.test.ts, "applies diffs and tombstones on the interval": its afterEach rmSync hit ENOTEMPTY on the temp directory, probably because a background write was still running. Reported on #86.

Definition of done

  • Find the cause of each and fix it in the test or in the code, whichever is wrong. Typical causes are awaiting a real event rather than elapsed time, and closing the library and waiting for its background work before removing the directory. Do not add retries or longer timeouts to hide the failure.
  • Show the fix holds: run each test file many times with make test (for example 30 runs, one at a time) and state the count in the PR body.
  • make check green; TODO.md updated in the same commit.

Model: opus-5-5

Two tests failed once during reviews and passed on rerun. A gate that sometimes fails can hide a real failure or block a merge that should go through. - `test/library/precache.test.ts`, "starts both precaches from open() and reports them in status()". Reported on https://git.eeqj.de/sneak/quak/pulls/86. - `test/library/library.test.ts`, "applies diffs and tombstones on the interval": its `afterEach` `rmSync` hit `ENOTEMPTY` on the temp directory, probably because a background write was still running. Reported on https://git.eeqj.de/sneak/quak/pulls/86. ## Definition of done - Find the cause of each and fix it in the test or in the code, whichever is wrong. Typical causes are awaiting a real event rather than elapsed time, and closing the library and waiting for its background work before removing the directory. Do not add retries or longer timeouts to hide the failure. - Show the fix holds: run each test file many times with `make test` (for example 30 runs, one at a time) and state the count in the PR body. - `make check` green; `TODO.md` updated in the same commit. Model: opus-5-5
clawbot self-assigned this 2026-09-23 03:14:57 +02:00
Author
Collaborator

Fixed in #92. The interval test removed the cache directory while a refresh was still writing into it. Library.close() now returns a promise that resolves once that refresh has finished, and the tests await it. The precache test now waits for the fills to report "done" instead of waiting for its stub source to be called.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/quak/pulls/92. The interval test removed the cache directory while a refresh was still writing into it. `Library.close()` now returns a promise that resolves once that refresh has finished, and the tests await it. The precache test now waits for the fills to report "done" instead of waiting for its stub source to be called. 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/quak#90