Keep CI's /tmp in memory so no test waits on the runner's disk (#299) #300

Merged
cmoriarty merged 6 commits from claude/ci-flake-299 into main 2026-10-29 02:05:58 -04:00
Owner

For braid#299. The issue stays open until five CI runs in a row pass, including a push that overlaps a deploy.

What was slow
Small tests that create or close a SQLite file in their own body. Both sync the file to disk, and on a busy runner one sync took a second or more:

  • runs 246 and 249: test_a_reconnect_backfill_adds_nothing_the_stream_already_delivered, 1.6 s. In run 249 two workers hit it at the same moment.
  • run 252: test_migrating_twice_changes_nothing, 1.0 s.

Neither test has a wait of its own: locally the reconnect test's whole body takes about 6 ms.

Change

  • CI: the job's /tmp, where pytest's tmp_path and the browser tests' servers keep their files, is now a 1 GB tmpfs, where a sync costs nothing. The backend tests write about 30 MB there. A first step fails the job if /tmp is not a tmpfs, so a runner that dropped the option is caught at once.
  • Tests: the reconnect test builds its store in the shared store fixture, as every other store test does. The fixture moves from tests/store/test_store.py to tests/conftest.py. On its own this only moved the failure to another test (run 252), so the tmpfs is the fix.

Checked

  • ./tools/test.sh passes locally in 16 s.
  • CI runs listed in the comments as they land.

🤖 Generated with Claude Code

For braid#299. The issue stays open until five CI runs in a row pass, including a push that overlaps a deploy. **What was slow** Small tests that create or close a SQLite file in their own body. Both sync the file to disk, and on a busy runner one sync took a second or more: - runs 246 and 249: `test_a_reconnect_backfill_adds_nothing_the_stream_already_delivered`, 1.6 s. In run 249 two workers hit it at the same moment. - run 252: `test_migrating_twice_changes_nothing`, 1.0 s. Neither test has a wait of its own: locally the reconnect test's whole body takes about 6 ms. **Change** - **CI:** the job's `/tmp`, where pytest's `tmp_path` and the browser tests' servers keep their files, is now a 1 GB tmpfs, where a sync costs nothing. The backend tests write about 30 MB there. A first step fails the job if `/tmp` is not a tmpfs, so a runner that dropped the option is caught at once. - **Tests:** the reconnect test builds its store in the shared `store` fixture, as every other store test does. The fixture moves from `tests/store/test_store.py` to `tests/conftest.py`. On its own this only moved the failure to another test (run 252), so the tmpfs is the fix. **Checked** - `./tools/test.sh` passes locally in 16 s. - CI runs listed in the comments as they land. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(agent): build the reconnect backfill test's store in a fixture
All checks were successful
test / suite (pull_request) Successful in 36s
65f3a87ec7
The test created, migrated and closed its database inside its own body, the only small test
that did. Creating and closing a SQLite file both sync it to disk, and on a loaded CI runner
that wait landed in the test's timed call: 1.6 s against its 1 s limit on CI runs 246 and 249
(braid#299). Locally the whole body takes about 6 ms and has no wait of its own.

The `store` fixture moves from tests/store/test_store.py to tests/conftest.py, so the store is
built and closed outside the timed call, as every other store test already does. A commit in
WAL mode with synchronous=NORMAL does not sync, so what is left in the call never waits on disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: run the suite again (braid#299 asks for five passing runs in a row, 2 of 5)
Some checks failed
test / suite (pull_request) Failing after 31s
06d51c8164
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: keep the suite's /tmp in memory
All checks were successful
test / suite (pull_request) Successful in 33s
01623a7598
Run 252 failed on test_migrating_twice_changes_nothing (1.0 s against 1 s), after the reconnect
test's store moved to a fixture: another small test that creates and closes a SQLite file in its
body, so the same disk sync on a busy runner landed in it instead (braid#299). The fix belongs
to the runner, not to one test at a time.

The job's /tmp, where pytest's tmp_path and the browser tests' servers keep their files, is now a
1 GB tmpfs, where a sync costs nothing. The backend tests write about 30 MB there. A first step
fails the job if /tmp is not a tmpfs, so a runner that dropped the option is seen at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmoriarty changed title from Build the reconnect backfill test's store in a fixture (#299) to Keep CI's /tmp in memory so no test waits on the runner's disk (#299) 2026-10-29 02:03:05 -04:00
ci: run the suite again (braid#299 asks for five passing runs in a row, 2 of 5)
All checks were successful
test / suite (pull_request) Successful in 37s
944205e885
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: run the suite again (braid#299 asks for five passing runs in a row, 3 of 5)
All checks were successful
test / suite (pull_request) Successful in 36s
40f61dfa33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: run the suite again (braid#299 asks for five passing runs in a row, 4 of 5)
All checks were successful
test / suite (pull_request) Successful in 42s
6c9bde72c8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmoriarty deleted branch claude/ci-flake-299 2026-10-29 02:05:58 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid!300
No description provided.