Skip to content

Run CI's Python suite under eatmydata - #3243

Merged
max-sixty merged 4 commits into
mainfrom
agent-a807a335d28997bb2
Oct 20, 2026
Merged

max-sixty merged 4 commits into
mainfrom
agent-a807a335d28997bb2

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Leaf fsyncs every file a revision stages (revision_artifact._write) and every file replace_bytes writes, so each serve publish and page init syncs the vendored layer file by file. No test can observe that durability short of a crash. This runs the Python suite under eatmydata, which preloads a library that turns fsync into a no-op in every process the suite starts. Product code is unchanged; tests that patch os.fsync in Python still see each call, and the suite's temp files stay on the same ext4 disk, so filesystem behavior such as hard-link limits is unchanged. A tmpfs basetemp would also remove the cost, but it would hold the whole run's temp files in the runner's memory.

PR run tests worker-min CPU-min pytest step innermost _write unlink replace_bytes
39370118607 (before) 1896 16.2 11.2 5:51 2.2 1.1 0.5
39373342406 (before) 1895 16.3 11.2 5:55 1.7 1.1 0.6
39366958441 (before) 1893 16.1 11.6 5:52
39374669527 (this branch) 1894 14.6 12.2 5:28 <0.1 0.1 0.2
39375813406 (this branch) 1894 15.7 13.3 5:49 <0.1 0.2 0.3

Frame columns are py-spy minutes from leaf-dev suite-profile. The fsync frames are gone, and the unlink in the page pool's reset fell with them, which fits ext4 metadata operations waiting on journal commits that other workers' fsyncs forced. Worker time fell by 0.5 to 1.6 minutes, less than the roughly 3 minutes the frames held, and CPU-minutes rose by 1 to 2 on both runs. The syncs were waits rather than CPU; whether the CPU rise is runner variance or work that waiting used to hide (three workers on four vCPUs, beside the website build) two runs can't tell. Per file, test_interact_document.py fell from 1.4 to 0.9–1.0 minutes and test_interact_server.py from 1.6–1.7 to 1.3–1.5.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 19, 2026 22:23
Leaf fsyncs every file a revision stages and every file `replace_bytes`
writes, so each `serve` publish and `page init` syncs the vendored layer
file by file. No test can observe that durability short of a crash, yet on
the runner's disk the syncs cost about a sixth of a pull request's worker
time: py-spy put `_write` (`revision_artifact.py`) and `replace_bytes` as
the innermost frame for 2.7 of 16.2 worker-minutes in run 39370118607.

eatmydata preloads a library that turns fsync into a no-op for the suite's
processes, leaving product code unchanged. Python-level patches of
`os.fsync` that tests make still see each call. The suite's basetemp stays
on the same ext4 disk, so filesystem behavior such as hard-link limits is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 20, 2026
@max-sixty
max-sixty merged commit cf805f1 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a807a335d28997bb2 branch October 20, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants