Skip to content

perf(tests): remove fixed waste in six slow tests - #4995

Merged
dan-petty merged 2 commits into
mainfrom
perf/4706-remove-test-waste
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
perf/4706-remove-test-waste

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Six tests did work they do not check.

  • The documented argv test collects the document references one time, not two.
  • The docs CLI test no longer exports the JSON schema. The dry-run docs test writes that file and now reads its groups key. The docs CLI test is not faster: two argv checks take most of its time. Its time target moves to perf(docs): match the inventory globs with one pattern for each class #4979.
  • The forage dry run gets a directory of one file with --repo, not this repository with 40 git calls.
  • malformed_endpoint shuts its socket down before it closes it, so accept() wakes and the teardown does not wait 2 s. It fails when the thread does not end.
  • The Service memory test and the spec scenario of the heap use 50 rounds, not 200, with the same budget. A store with no byte bound still fails the test.
  • The chunker property no longer sets deadline=800, which failed correct code on a loaded host.

No code under src/ changes.

Closes #4706

Change: openspec/changes/archive/2026-11-12-4706-remove-fixed-waste-in-six-slow/

Collect the document references one time in the documented argv test.
Leave the JSON export to the dry-run docs test, which now reads its
groups key. Give the forage dry run a directory of one file with --repo.
Shut down the listener of malformed_endpoint before it closes, so the
accept() of its thread returns at once. Run the Service memory test for
50 rounds with the same budget. Remove deadline=800 from the chunker
property, so the ci profile applies.

Refs #4706
@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/tests The test suite, its fixtures, fakes and floor labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Before and after (test seconds)

One pytest process (-n 0, no coverage) for each tree, origin/main first, then this branch, at a load average of about 19 on 16 CPUs. The host load inflates all times against the audit numbers in #4706, so compare the two columns, not the audit.

Test Before (s) After (s)
test_every_hand_written_document_names_only_real_commands 31.32 14.61
test_docs_cli_generate_and_check 39.14 41.99
forage dry run (test_no_external_request_commands_run[ai research forage...], now test_forage_dry_run_runs_on_the_repository_it_is_given) 35.00 2.89
teardown of test_metrics_snapshot_prints_scrape_errors_and_target_as_written (malformed_endpoint) 2.01 < 0.05
memory test of the Service (200 rounds, now 50) 70.83 26.63
test_chunker_hypothesis_properties[py] 7.19 2.43
All 17 selected tests 214.61 115.84

The memory test alone, one tree after the other: 101.13 s before, 17.83 s after.

test_docs_cli_generate_and_check builds the command tree three times, not four, but its time stays within noise. A cProfile run at origin/main put 61% of its time in the two check_documented_argv calls of check and generate --check and 1% in to_json_dict. The plan keeps both check paths, and tests/invariants/test_source_tree.py bans a patch of a devops-cli name. #4979 makes the inventory scan of these checks faster in src/.

Proof that the 50-round memory test still finds a leak

With the store of SessionGitHubAPI changed to a plain dict (no bound), the 50-round test failed:

AssertionError: The heap grew 40.5 MiB between round 10 and round 50, past the 6 MiB the rest of the process may gain

The tree was restored after the run. With the real store, the test passes.

The deadline defect at origin/main

A run at origin/main at a load average of about 60 failed with the old setting:

FAILED tests/ai/rag/test_polyglot_chunking.py::test_chunker_hypothesis_properties[py] - DeadlineExceeded('Test took 4076.22ms, which exceeds the deadline of 800.00ms.

This is a perf change of tests with no change under src/, so devops ci fail-to-pass --base origin/main has no defect to replay: each changed test passes on the base source too. The two runs above are the proofs.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 09:23
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings

# Severity Finding Verdict Action
1 Major The PR closes #4706, but test_docs_cli_generate_and_check does not get faster, and the PR body did not say this. Confirmed PR body and #4979 changed. No code change.

Finding 1

Evidence. An acceptance criterion of #4706 is "Each named test takes less time than the time given above". For tests/docs/test_docs.py that time is 5.51 s. The before and after comment of this PR gives 39.14 s before and 41.99 s after for test_docs_cli_generate_and_check on the same loaded host. Only that comment and the Impact section of the proposal said this. The PR body is the squash commit message, and it did not say it.

What I did.

  1. The PR body now says that the docs CLI test is not faster, because two argv checks take most of its time, and that its time target moves to perf(docs): match the inventory globs with one pattern for each class #4979. The body stays at 994 characters before its trailers (the limit is 1000), so I made the other bullets shorter with the same facts.
  2. perf(docs): match the inventory globs with one pattern for each class #4979 has a new acceptance criterion: tests/docs/test_docs.py::test_docs_cli_generate_and_check takes less time than the 5.51 s that perf(tests): remove fixed waste in six slow tests #4706 gives for it.
  3. I did not change code and did not push. The head stays 0da975390, which contains the current origin/main. The edit of the PR body started the PR title and fail-to-pass checks again.

Owner step. Decide if this partial delivery can close #4706. If it cannot, change Closes #4706 in the PR body to Part of #4706 before the merge.

@dan-petty
dan-petty merged commit 1c7044e into main Nov 12, 2026
26 checks passed
@dan-petty
dan-petty deleted the perf/4706-remove-test-waste branch November 12, 2026 12:08
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.118.0](v0.117.2...v0.118.0)
(2026-11-12)


### Features

* **ci:** devops ci stops its rows when timeout ends it
([#5031](#5031))
([1fa4e9c](1fa4e9c))
* **roadmap:** keep the stage gate problems as a list with a code
([#5022](#5022))
([5819627](5819627))
* **roadmap:** log one result line for each roadmap job attempt
([#4966](#4966))
([2b6fe3f](2b6fe3f))
* **telemetry:** record each CLI usage error by name and kind
([#4973](#4973))
([a179fd9](a179fd9))


### Bug Fixes

* **ai:** chat loads each persona prompt and challenger gets tools
([#5037](#5037))
([c40b0ad](c40b0ad))
* **ai:** keep the HTTP status of a Claude reply after retries
([#4976](#4976))
([5bf9466](5bf9466))
* **deps:** keep Renovate uv bumps green and groups on Monday
([#4987](#4987))
([b19e153](b19e153))
* **k8s:** raise the limits that 7 d of use shows are too low
([#5030](#5030))
([028c62b](028c62b))
* **roadmap:** a job posts no comment that repeats a recent one
([#4978](#4978))
([fff903a](fff903a))
* **service:** alert when GitHub cannot deliver a webhook
([#5045](#5045))
([2bfbfcb](2bfbfcb))
* **service:** delete the stream route that sends canned verified text
([#5038](#5038))
([e9d51b5](e9d51b5))
* **telemetry:** keep one upstream status series per service
([#4986](#4986))
([3e4ca56](3e4ca56))
* **tests:** remove the runner variable in the test floor
([#4988](#4988))
([093aa61](093aa61))


### Performance Improvements

* **ai:** make the ast graph walk and call search faster
([#5039](#5039))
([3b25cc6](3b25cc6)),
closes [#4662](#4662)
* **ci:** build the devcontainer only on its own inputs
([#4977](#4977))
([c5b15ac](c5b15ac))
* **ci:** test each merge once, on the push to main
([#5043](#5043))
([c6992b1](c6992b1))
* **tests:** remove fixed waste in six slow tests
([#4995](#4995))
([1c7044e](1c7044e))


### Code Refactoring

* **ai:** delete devops ai pipeline and persona leftovers
([#5044](#5044))
([d5fefde](d5fefde)),
closes [#4827](#4827)
* **openspec:** split big capabilities into nested ones
([#4981](#4981))
([dfb09bd](dfb09bd))
* **pr:** devops pr update acts only on a failed check
([#4990](#4990))
([aa4fa1a](aa4fa1a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(tests): remove fixed waste in six slow tests

1 participant