Conversation
Every install in the installer tests self-tests its copy with three Python starts (the module import and two --help runs), and that was nearly all of each test's time: the copies one test file makes are nearly all byte-identical. install_fixture now gives the loaded engine a subprocess whose self-test runs (this Python, cwd a copied tree) keep a pass per command and tree digest (names, modes, owners, bytes, link targets). A failure always runs again, and any change to the tree or the command (modules, --help asked for, a RedCheck break) is a new run, so no broken copy is hidden. tree_problems still runs every time. Locally: golive/tests/install.test.py 92 s -> 28 s, common/tests/kit_install.test.py 99 s -> 37 s, the other installer tests 2-9 s -> about 1 s each. Weights in fork-ci-tests.txt follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Slow-test hunt.
fork-kit/golive/tests/install.test.py(weight ~168s, the slowest fork-kit file) andfork-kit/common/tests/kit_install.test.py(~95s) spent nearly all their time in one place. A profile of one golive test put about 95% of it inkit_install.self_test. Every install self-tests its copy with three Python starts (the module import and two--helpruns), and the copies a test file makes are nearly all byte-identical. RedCheck adds 58 more installs to golive's file on its own.What
fork-kit/common/tests/install_fixture.py:load()gives the engine asubprocess(SelfTestRuns) that records a passing self-test run. The record is keyed on the command (with the copy's path left out) and a digest of the copied tree (names, modes, owners, bytes, link targets). A run whose command and tree match a recorded pass is not run again.MODULES, the--helpasked for, a RedCheck break that changes the call) is a new run, so the shortcut never hides a broken copy.tree_problems(in-process) still runs every time. Any other command goes to the realsubprocess.subprocessonly inself_test. The bootstrap and the tests' own subprocess calls are not affected.kit_install.test.pygets a newSelfTestRunsclass with five tests: a pass runs once for the same tree wherever it is; a failure runs again; a changed byte, mode, file or command runs again; other commands are the real subprocess; the engine is wired to it. All five fail on main's fixture (5 errors) and pass with this change..github/fork-ci-tests.txt: golive install ~168s → ~50s, kit_install ~36s. Both are estimates: local time times each file's old CI/local ratio. If CI measures a different value, its weight check will name the number to write.Timing (same machine, run one after the other, clean
origin/mainexport vs this branch)Every file has the same results before and after. golive shows 2 errors on both sides from the local sandbox, not from this change:
test_the_hand_copy_comes_back_with_its_own_mode_and_ownercannotchmod 4755in its temp folder there. CI runs it.Most of golive's remaining ~28s is four RedCheck mutants that block until
no_hang's 5 s alarm fires (~21s). This PR leaves that alone.Checks run
node --test .github/scripts/fork-ci-tests.test.cjs(81 pass)No unexplained test failure turned up in the last 40 failed runs: each one traced to its own PR's change, or to a dispatch that tested a PR's tree.
🤖 Generated with Claude Code