Skip to content

fix(ci): Size narrowed test workers by collected tests - #5547

Merged
dan-petty merged 5 commits into
mainfrom
fix/4472-a-narrowed-ci-test-runs-many
Nov 14, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/4472-a-narrowed-ci-test-runs-many

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

A narrowed devops ci test run chose its worker count from the number of test files, so a selection of 7 files that hold 399 slow tests ran serially and hit the 1800 s timeout. The run sizes its workers from the tests that it selects, so that selection runs in parallel and ends inside the timeout (#4472).

Closes #4472

Change: openspec/changes/archive/2026-11-13-4472-a-narrowed-ci-test-runs-many/

@devops-cli-service
devops-cli-service Bot force-pushed the fix/4472-a-narrowed-ci-test-runs-many branch 3 times, most recently from 666c309 to ecb8c98 Compare November 13, 2026 21:47
@devops-cli-service

devops-cli-service Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Step Status Attempts Tokens in/out Last failing command
group 2 done 1 1450002/8562 -
group 3 done 1 3030962/14581 -
fix done 1 5340445/27116 -
  • scoped check pre-push: passed, 9 s
  • scoped check static: passed, 24 s
  • scoped check tests: passed, 46 s
  • scoped check pre-push: passed, 7 s
  • scoped check static: passed, 24 s
  • scoped check tests: passed, 46 s
  • scoped check tests: the changed files select more than 30 test modules, so only the changed test modules ran. The required checks of CI run the others
  • verify of group 2: uv run devops ci test tests/commands/test_ci.py tests/commands/test_ci_repeat.py exits 0.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
Elapsed: 47s
  • verify of group 3: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/agent/worktrees/w-4472
\u2713 All documentation files are up to date.
Bytecode compiled 19311 files in 440ms
Bytecode compiled 19311 files in 471ms
Elapsed: 8.52s
Elapsed: 12s
  • verify of group 0: uv run devops ci test tests/commands/test_test_selection.py exits 0.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
Elapsed: 30s
  • verify of group 0: uv run devops ci test tests/commands/test_ci.py tests/commands/test_ci_repeat.py exits 0.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
/home/devops/.data/agent/worktrees/w-4472/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
Elapsed: 46s
  • verify of group 0: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/agent/worktrees/w-4472
\u2713 All documentation files are up to date.
Bytecode compiled 19311 files in 470ms
Bytecode compiled 19311 files in 494ms
Elapsed: 8.43s
Elapsed: 11s

@devops-cli-service devops-cli-service Bot added type/bug Type bug: the code does not do what it must scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 13, 2026
@devops-cli-service
devops-cli-service Bot force-pushed the fix/4472-a-narrowed-ci-test-runs-many branch 2 times, most recently from e6e78c6 to b15a3b9 Compare November 13, 2026 22:21
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

  • scoped check pre-push: passed, 22 s
  • scoped check static: passed, 97 s
  • scoped check tests: passed, 180 s
  • scoped check tests: the changed files select more than 30 test modules, so only the changed test modules ran. The required checks of CI run the others

@devops-cli-service
devops-cli-service Bot force-pushed the fix/4472-a-narrowed-ci-test-runs-many branch from b15a3b9 to ea3e430 Compare November 13, 2026 23:35
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

  • scoped check pre-push: passed, 23 s
  • scoped check static: passed, 106 s
  • scoped check tests: passed, 185 s
  • scoped check tests: the changed files select more than 30 test modules, so only the changed test modules ran. The required checks of CI run the others

@devops-cli-service
devops-cli-service Bot force-pushed the fix/4472-a-narrowed-ci-test-runs-many branch from ea3e430 to d62a6f4 Compare November 13, 2026 23:47
devops-cli-service Bot and others added 5 commits November 14, 2026 01:50
The test module imported DEFAULT_CI_TEST_SERIAL_MAX_TESTS at module level.
That name is not on the base, so the Fail-to-Pass replay could not collect
the module and no case of it ran there. The boundary case now reads the
limit from the defaults module in its body. A new case runs the selection
of the issue, 7 test modules that collect 399 tests. The file count gives
it -n 0 on the base, and the head gives it the capped workers.
@dan-petty
dan-petty force-pushed the fix/4472-a-narrowed-ci-test-runs-many branch from 5ba86f2 to 665a80b Compare November 14, 2026 02:12
@dan-petty

Copy link
Copy Markdown
Owner

The Fail-to-Pass Check failed at 5ba86f2. This push (665a80b) fixes the test that proves the fix. The product code is the same.

Cause of the failure

tests/commands/test_test_selection.py imported DEFAULT_CI_TEST_SERIAL_MAX_TESTS at module level. origin/main does not have this constant, so pytest could not collect the module on the base. No case of the module ran there (the 1 errored case). The changed cases in tests/commands/test_ci.py and tests/commands/test_ci_repeat.py only skip the collection child, so they pass on the base, as they must.

What changed

  • New case test_a_few_test_modules_that_collect_many_tests_run_on_the_capped_workers. It is the selection of fix(ci): a narrowed ci test runs many slow tests serially #4472: 7 test modules whose collection gives 399 test ids. On the base, the file count gives it -n 0: assert (0, [[['-n', '0']]]) == (0, [[['-n', '4']]]). On the head, it runs on DEFAULT_CI_TEST_NARROWED_WORKERS.
  • test_a_selection_past_the_collected_test_limit_runs_on_the_capped_workers reads the limit from the defaults module in its body. Thus the module imports on the base. The module-level import of the new constant is gone.
  • The plan tells the same: tasks 1.1 and 1.2, and one new decision in design.md.
  • The branch is now on origin/main 79eb893, with no merge commit. The OpenSpec archive commit stays last. No threshold, skip or marker changed.

Proof

  • uv run devops ci fail-to-pass --base origin/main: 7 failed and 222 passed on the base, 0 errored.
  • The new case on a clean origin/main worktree fails with the assertion above.
  • uv run devops ci test tests/commands/test_test_selection.py tests/commands/test_ci.py tests/commands/test_ci_repeat.py: 229 passed, on 4 workers.
  • uv run devops ci --check --only lint,format,typecheck,openspec: all pass.

Before the push, no active devops-cli-runner Job had --item 4472. The pull request stays a draft.

@dan-petty
dan-petty marked this pull request as ready for review November 14, 2026 02:20
@dan-petty
dan-petty self-requested a review as a code owner November 14, 2026 02:20
@dan-petty
dan-petty merged commit 2126dc6 into main Nov 14, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/4472-a-narrowed-ci-test-runs-many branch November 14, 2026 02:21
dan-petty pushed a commit that referenced this pull request Nov 14, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.136.0](v0.135.0...v0.136.0)
(2026-11-14)


### Features

* **roadmap:** audit the test registry declarations
([#5594](#5594))
([130e428](130e428))


### Bug Fixes

* **ci:** Size narrowed test workers by collected tests
([#5547](#5547))
([2126dc6](2126dc6))

---
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/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): a narrowed ci test runs many slow tests serially

1 participant