Repository navigation
Make CI finish in about a third of the time - #7
Merged
Merged
Conversation
Four minutes of a six-minute release were one pytest step, and nearly all of that was test_backtest.py running 36 independent replays one after another. `-n auto` spreads them. The catch is tests/test_postgres.py: it shares one database and resets by emptying `public`, so two of its tests on different workers drop each other's tables -- `--dist load` gives four errors on one run and four failures on the next, moving around. The file carries an `xdist_group` mark now and `--dist loadgroup` keeps it on one worker while everything else still spreads a test at a time. Locally, with a server up: 81s serial, 27s across ten cores, 198 passed either way and three times running.
A replay re-runs the whole pipeline once per rebalance date, so what this file costs is stops, not rows -- and `_window` takes half of the scaffold's 420 days, which at `rebalance: 5d` is about 39 stops, thirty-six times over. 150 days leaves around a dozen stops, which every assertion here still has room for. The file goes from 68s to 29s on its own. Two tests write their windows as dates rather than deriving them from the feed, and a short feed ends after they start. They ask for `days=420`, which is what the parameter is for.
fidetolabs
force-pushed
the
faster-ci
branch
from
September 21, 2026 12:23
20ff94d to
f77f49e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four of the six minutes a release takes were one
pyteststep, and nearly all ofthat was
test_backtest.pyrunning 36 independent replays one after another.Two changes, one commit each.
Run the suite across cores.
pytest-xdist, with-n auto --dist loadgroupinboth workflows. The catch is
tests/test_postgres.py: it shares one database andresets by emptying
public, so two of its tests on different workers drop eachother's tables. Plain
--dist loadgives four errors on one run and four failureson the next, moving around between runs. The file carries an
xdist_groupmarknow, which keeps it on a single worker while everything else still spreads a test
at a time.
Replay over less history. A replay re-runs the whole pipeline once per
rebalance date, so what that file costs is stops, not rows -- and
_windowtakeshalf of the scaffold's 420 days, about 39 stops, thirty-six times over. 150 days
leaves around a dozen, which every assertion still has room for. Two tests write
their windows as dates rather than deriving them from the feed, and a short feed
ends after they start; they ask for
days=420.Measured
On a runner,
test (3.12), thepyteststep:3.7x. The two changes compound -- the shorter feed is worth about 2x whatever the
core count, and xdist takes what is left.
the Postgres tests must have actually runstill passes, so the group did not turn them into skips.On
release.ymlThat file runs only on a tag, so nothing in it can be proven by this PR. Its only
change here is the same
pytestflagtest.ymljust ran green -- deliberately.Folding
announceintopublishwould have saved another ~45s of runner boot,but it would have put an untested step after the PyPI upload, and PyPI will not
take the same version twice: publish succeeds, release page fails, and the tag
cannot be retried. Not worth 45 seconds. Left as two jobs.
https://claude.ai/code/session_01GN79GJbvpEiwuRB23ZDkXt