Repository navigation
Conversation
The complete suite's test job takes about four hours and its junit report records one total per test, so nothing said how a browser test's ~8.5 s splits between setup, page preparation, waiting on the browser, and the test's own Python. The test job now records three readings beside the junit report and prints a summary of them into the job summary: - `leaf_dev.suite_profile`, a pytest plugin in addopts, gives each test a junit `profile` property: its setup, call and teardown seconds, and its time in Playwright's sync API keyed by method and calling frame. Playwright runs its event loop in a second greenlet, so a sampling profiler sees a browser wait as an idle event loop with the test off the stack; timing each call where it is made keeps the attribution. - py-spy samples every Python process the run starts at 20 Hz, waits included, for the suite's own Python by function. - BSD process accounting gives the run's CPU by command, for Chrome, Node and the servers no Python stack shows. The job is CPU-bound, so this is where the runner's capacity goes. `leaf-dev suite-profile DIR` reads the three from a downloaded `pytest-results-*` artifact. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The PR run's stacks held command lines with newlines and bytes that are not UTF-8, which the line-by-line reader rejected. At 20 Hz py-spy took 16 of the run's 157 CPU minutes; 5 Hz keeps thousands of samples an hour per worker. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
At 5 Hz py-spy still took 4.5% of the PR run's CPU. The job's PY_SPY_RATE now sets both py-spy's rate and the rate leaf-dev suite-profile turns samples into minutes with. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ild processes The wrapper's frame sat between Playwright and the caller, so Playwright's traces and protocol metadata named the profiler as each call's site; its code is now filed under Playwright's package, which that attribution skips. A call failure with a teardown error is two junit cases, the profile on the second; the summary now reads them as one test. The summary also lists the Python processes tests start, whose work a test's own stack shows only as a wait. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Process accounting is machine-wide, and a pull request's job builds the website beside the suite, so its table mixed the two. Main, the schedule and a dispatch run nothing else meanwhile. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A py-spy that could not attach or sample left the job green with no stacks, and the summary skips a missing stacks.txt, so the reading would vanish unnoticed. The job now fails, keeping pytest's own failure status where it has one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main's vulture hook, which arrived beside #2345, flags it; pluggy passes a hook implementation only the arguments it names. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 11, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 11, 2026
Reuse the bounded CI correction from #2393: pluggy supplies only named hook arguments, so the unused nextitem parameter is unnecessary. Verified that passing browser cases still emit their profile properties.
This was referenced Oct 11, 2026
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.
#2345 landed beside the vulture pre-commit hook, which flags
nextiteminleaf_dev.suite_profile.pytest_runtest_protocolas unused, so main'slintfails at 39f03c8. pluggy passes a hook implementation only the arguments it names, so the hook now takesitemalone. A run with the plugin still writes each test'sprofileproperty.