Skip to content

ci: Changed-Test Independence times out on a large test change #6564

Closed

Description

@dan-petty

Problem

The job Changed-Test Independence (.github/workflows/ci.yml, timeout-minutes: 15) runs each changed test file three times in shuffled order with devops ci test --repeat 3, in one process. Its time grows with the number of changed test files. A pull request that changes many test files reaches the job timeout, and GitHub cancels the job. The cancel tells nothing about test independence.

Measured on PR #6562 (head e78252815): the job collected 1,473 changed tests at 21:00:58, and one pass took 454 s. The second pass was cancelled at 21:15:31. The next head of the same PR changes more tests. The required check Tests & Coverage runs the whole suite in five shards at about 290 s each, so this job takes more time than the full test check.

The check is not required, so it does not block a merge. But a cancelled run gives no result, and a check that runs over 5 min + 1 min is a P0 bug (AGENTS.md rule 5).

Expected

The job gives a pass or fail result for each pull request, inside the 5 min + 1 min limit, with no lower timeout and no smaller set of changed tests. Possible ways: run the repeats in parallel workers, or in shards as Tests & Coverage does. Do not raise the timeout.

Proof

A pull request that changes more than 1,000 tests finishes the job with a result, under 6 min.

Source

Source: #6562

Alternatives check of 2026-11-20: not-applicable.
Class: ci, no search.
Tool: none found.

Proposed design

Problem statement

The Changed-Test Independence job runs each changed test file three times in one process. Its time grows with the number of changed test files, and a large pull request reaches the 15-minute job limit. GitHub then cancels the job, and the cancel gives no result. The change splits the changed files across shard jobs and adds one aggregate job. The check then gives a pass or fail result under 6 minutes, with the same tests and the same three passes.

Acceptance criteria

Requirement: Shard selection of a changed-test run

devops ci test SHALL apply --shard N --shards M to the test files that it runs.

Scenario: Three shards of a changed-file list

  • WHEN a test runs devops ci test with --shard 2 --shards 3 on a list of changed test files
  • THEN the run collects only the files of shard 2, and the three shard lists together hold each file of the list exactly once

Requirement: Repeat passes of one shard

A sharded run of devops ci test --repeat 3 SHALL run each of its three passes over the files of its own shard only.

Scenario: Three shuffled passes of shard 1

  • WHEN a test runs devops ci test --repeat 3 --shard 1 --shards 2 on a list of changed test files
  • THEN each of the three passes gets every file of shard 1, and no file of shard 2

Requirement: No cached verdict in a sharded run

A sharded run of devops ci test SHALL read no cached verdict and SHALL write none.

Scenario: Sharded run with a cache present

  • WHEN a test runs devops ci test --shard 1 --shards 2 with a cached verdict in the data directory
  • THEN the run ignores the cached verdict and leaves the cached file unchanged

Requirement: Workflow gate on the edited workflow

The change SHALL keep .github/workflows/ci.yml valid for the actionlint and zizmor rows.

Scenario: The workflow gates on the edited file

  • WHEN a contributor runs uv run devops ci --check --only actionlint,zizmor
  • THEN the command exits 0 and reports no finding

Requirement: The independence check finishes under 6 minutes

The Changed-Test Independence check SHALL run the changed test files in shard jobs with one aggregate job, and SHALL give a pass or fail result in under 6 minutes for a pull request that changes more than 1,000 test files.

Scenario: A pull request with more than 1,000 changed tests

  • WHEN a pull request that changes more than 1,000 test files runs the workflow
  • THEN the check shows one Changed-Test Independence (shard N of M) job for each matrix entry and one aggregate Changed-Test Independence job, and it ends with a pass or fail result in under 6 minutes

Requirement: Aggregate result of the shard jobs

The aggregate Changed-Test Independence job MUST fail when any shard job fails.

Scenario: One failing shard

  • WHEN one shard job of the check fails on a pull request
  • THEN the aggregate job ends red and its log names the result of each shard job

Existing Tool Considered

The alternatives block of 2026-11-20 in the issue body holds the result for this item, and it names no tool. The closest open, maintained library is pytest-xdist (https://pypi.org/project/pytest-xdist/). It runs tests in parallel workers inside one process, so it lacks a shard job with its own time bound and a matrix that GitHub shows as separate jobs. The change reuses the shard mechanism that the project keeps in devops ci test --shard/--shards and the GitHub Actions matrix. Written cost of the code that the project keeps: about 150k tokens to build, keep and fix, and about 4 hours of elapsed time.

Key questions

  • How does the check give a result under 6 minutes with the same tests and no higher timeout?: Split the changed test files across a matrix of shard jobs and add one aggregate job, as Tests & Coverage does. Each shard runs the three shuffled passes over its own files. (best practice) [sources: .github/workflows/ci.yml, openspec/specs/ci-test-shards/spec.md, AGENTS.md]
    • Chosen: Matrix of shard jobs and one aggregate job. The project records this pattern for long test work in the ci-test-shards spec, and the workflow already uses it for the suite.
    • Rejected: Three jobs, one for each repeat pass. It gives a 3x gain only, so a larger changed set still reaches the limit, and it needs a new option for the pass seed.
    • Rejected: Parallel workers of pytest-xdist in one job. It keeps one job and one time bound, and the workers share the state of one process.
    • Rejected: A higher job timeout. The issue forbids it, and the job still gives no result before the cancel.
  • How many shard jobs does the matrix hold, and how does the split balance the files?: Eight shard jobs. The test row balances the selected files by the recorded seconds in tests/module_durations.json, the record that the suite shards use. (best practice) [sources: .github/workflows/ci.yml, tests/module_durations.json]
    • Chosen: Eight shard jobs, balanced by the recorded seconds. The measured 454 s per pass over 1,473 tests gives about 57 s per pass in one shard, about 170 s for three passes, and about one minute of setup.
    • Rejected: Four shard jobs. The same measurement gives about 341 s for three passes, which leaves no margin under the 300 s step limit.
    • Rejected: A matrix that a prepare job computes from the recorded seconds. It needs a prepare job and a new command output, and the fixed matrix meets the proof of the issue.
  • Which job holds the check name Changed-Test Independence?: The aggregate job holds it, and the shard jobs are Changed-Test Independence (shard N of M). This mirrors Tests & Coverage and its shard jobs, and no ruleset reads the name because the check is not required. (best practice) [sources: .github/workflows/ci.yml, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Chosen: The aggregate job holds the name. A person reads one check with one result, as with Tests & Coverage.
    • Rejected: Each shard job holds the name. A matrix makes the name of the check unstable in the checks list.
    • Rejected: A new name for the check. It loses the history of the check, and no reason asks for it.
  • What does the aggregate job do when a shard job fails?: It fails and prints the result of each shard job, as the step Require Passing Test Shards does. (best practice) [sources: .github/workflows/ci.yml]
    • Chosen: Fail with the result of each shard. The step Require Passing Test Shards already does this, and one red check names the failed shard.
    • Rejected: Pass when the first shard passes. It hides a failed shard and gives a wrong result.
    • Rejected: Retry a failed shard once. A retry hides a flaky test that the check exists to find.
  • Does a sharded repeat run read or write the cached verdict?: No. A sharded run reads no cached verdict and writes none, because a shard's verdict is not the verdict of the whole set. (best practice) [sources: openspec/specs/ci-test-shards/spec.md]
    • Chosen: Read no cached verdict and write none. The ci-test-shards spec requires it for each sharded run.
    • Rejected: Reuse one cached verdict for each shard. The cached verdict covers the whole set, so a shard cannot use it.
    • Rejected: Write one cached verdict for each shard. A shard of a changed set is not stable between runs, so the cache would be stale.
  • Does devops ci test already take the shard selection?: Yes. The ci-test-shards spec says that the test row runs one shard of the suite, and the workflow calls the row with --shard and --shards. The change adds the --repeat interaction and the workflow matrix. [sources: openspec/specs/ci-test-shards/spec.md, .github/workflows/ci.yml]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/infra
    source/agent
    status/new
    effort/medium
    on Nov 20, 2026
  2. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P0-Critical. The job times out and gives no result, which the project rules define as a P0 bug.
    • Related: perf(ci): split the test check into more shards #4473, which asks for a different change. Both address a CI test job exceeding its time limit, but the candidate targets Changed-Test Independence while 4473 targets Tests & Coverage.
  3. added
    value/high
    priority/p0-critical
    on Nov 20, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 20, 2026
  5. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  6. added
    owner/service
    on Nov 20, 2026
  7. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Plan state: branch ci/6564-changed-test-independence-times-out-on, draft pull request #6568. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.

    The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:

    1. Split a given list of test files into shards by recorded seconds: 27059 tokens
    2. Take the shard options in the test command: 31848 tokens
    3. Run the changed-test check as a matrix of shard jobs: 31276 tokens
    4. Regenerate the command page of the ci group: 23304 tokens

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • minor criterion_dropped at issue (### Requirement: No cached verdict in a sharded run): The issue's criterion that a sharded devops ci test run reads and writes no cached verdict has no task in the plan, and the reason the plan gives cites a base requirement that names devops ci, not devops ci test. Evidence: "A sharded run of devops ci test SHALL read no cached verdict and SHALL write none."
    • minor spec_delta_wrong at spec ci-test-shards (The workflow runs Changed-Test Independence in shards): The scenario One failing shard joins the unassertable claim that the aggregate job ends red with an unrelated actionlint run, and it drops the issue's its log names the result of each shard job, so no test can assert the scenario's own subject. Evidence: "the job Changed-Test Independence ends red, and uv run devops ci --check --only actionlint,zizmor exits 0 on .github/workflows/ci.yml"
    • minor other at issue (A pull request that changes more than 1,000 tests finishes the job with a result, under 6 min.): The plan states no requirement for the issue's six-minute bound and no group measures the check's duration: the result rests on an estimate while the shard step keeps a twelve-minute limit under a fifteen-minute job. Evidence: "A pull request that changes more than 1,000 tests finishes the job with a result, under 6 min."
    • minor other at tasks (2): The group does not say what a sharded run does when the named paths force a full run, which _resolve_test_targets reports with None, so shard_paths would be handed no list and a shard could run the whole suite that the group means to prevent. Evidence: "replace the targets with the files of the shard: shard_test_files when the run names no path, shard_paths when it names paths"
    • minor false_premise at proposal (existing_tool): The plan repeats the issue's sentence on the written cost of the code with a figure the issue does not support, and gives no reason for the lower estimate. Evidence: "Written cost of the code that the project keeps: about 150k tokens to build, keep and fix, and about 4 hours of elapsed time."
  8. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    The stage job staged the plan of draft pull request #6568. The plan state comment of #6568 holds the branch, the task groups and the findings.

    The default branch changed these paths that the plan names, after the commit that the planner read. Read the commits before you judge the plan:

    The runs of the planner and the review made 207 model request(s), and used 15925471 input tokens and 326207 output tokens. The tool calls, in order:

    1. search_code({"text":"Changed-Test Independence"})
    2. read_spec({"capability":"ci-test-shards"})
    3. read_file({"path":".github/workflows/ci.yml","start_line":700,"end_line":880})
    4. read_spec({"capability":"ci-test-shards","requirement":"The test row runs one shard of the suite"})
    5. search_code({"text":"--repeat"})
    6. search_code({"text":"def shard"})
    7. search_code({"text":"_run_shuffled_repeats"})
    8. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":300,"end_line":400})
    9. read_file({"end_line":2400,"path":"src/devops_cli/commands/ci.py","start_line":2180})
    10. search_code({"text":"--shards"})
    11. file_symbols({"path":"src/devops_cli/commands/ci.py"})
    12. read_file({"end_line":870,"path":"src/devops_cli/commands/ci.py","start_line":806})
    13. read_file({"end_line":2180,"path":"src/devops_cli/commands/ci.py","start_line":2101})
    14. references({"name":"_run_shuffled_repeats"})
    15. search_code({"text":"shard_test_files"})
    16. search_code({"text":"repeat"})
    17. search_code({"text":"repeat_needs_targets"})
    18. search_code({"text":"--repeat\", \"3"})
    19. read_file({"path":"tests/commands/test_ci_repeat.py"})
    20. read_spec({"capability":"ci-test-shards","requirement":"A sharded run reads and writes no cached verdict"})
    21. read_spec({"capability":"ci-test-shards","requirement":"The workflow runs the test row in shards"})
    22. search_code({"text":"shards"})
    23. read_file({"end_line":1880,"path":"src/devops_cli/commands/ci.py","start_line":1760})
    24. search_code({"text":"rule 5"})
    25. read_file({"end_line":60,"path":"AGENTS.md","start_line":1})
    26. read_file({"end_line":70,"path":"docs/commands/ci.md","start_line":1})
    27. search_code({"text":"shard_above_total"})
    28. search_code({"text":"docs/commands/ci.md"})
    29. search_code({"text":"ci test"})
    30. search_code({"text":"ci_test"})
    31. search_code({"text":"devops ci test"})
    32. search_code({"text":"devops ci test [OPTIONS]"})
    33. search_code({"text":"First shuffle seed for --repeat"})
    34. read_file({"end_line":2002,"path":"src/devops_cli/commands/ci.py","start_line":1938})
    35. read_file({"end_line":960,"path":"src/devops_cli/lang/en/help.py","start_line":870})
    36. search_code({"text":"shard: str"})
    37. read_file({"end_line":1030,"path":"src/devops_cli/lang/en/help.py","start_line":1000})
    38. search_code({"text":"changed test files"})
    39. read_spec({"capability":"ci-test-selection"})
    40. search_code({"text":"Changed-Test"})
    41. read_file({"path":"tests/commands/test_ci.py","start_line":1870,"end_line":1915})
    42. read_file({"path":"openspec/specs/ci-job-time/spec.md","start_line":140,"end_line":170})
    43. read_file({"end_line":1870,"path":"tests/commands/test_ci.py","start_line":1790})
    44. search_code({"text":"changed-tests"})
    45. search_code({"text":"def shard_test_files"})
    46. read_file({"path":".github/workflows/ci.yml","start_line":735,"end_line":860})
    47. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":320,"end_line":420})
    48. read_file({"end_line":2400,"path":"src/devops_cli/commands/ci.py","start_line":2240})
    49. read_file({"end_line":1840,"path":"src/devops_cli/commands/ci.py","start_line":1815})
    50. read_file({"end_line":140,"path":"tests/commands/test_ci_shard.py","start_line":1})
    51. read_file({"end_line":1915,"path":"tests/commands/test_ci.py","start_line":1845})
    52. read_file({"end_line":2020,"path":"tests/commands/test_ci.py","start_line":1915})
    53. search_code({"text":"_validate_ci_workflow_parity("})
    54. read_file({"end_line":140,"path":"tests/commands/test_ci_repeat.py","start_line":100})
    55. search_code({"text":"class CICommandHelp"})
    56. read_file({"end_line":1010,"path":"src/devops_cli/lang/en/help.py","start_line":905})
    57. read_file({"end_line":25,"path":"AGENTS.md","start_line":1})
    58. read_spec({"capability":"ci-test-shards","requirement":"The workflow runs the test row in shards"})
    59. read_spec({"capability":"ci-test-shards","requirement":"The job Tests & Coverage aggregates the shards"})
    60. read_file({"end_line":1880,"path":"src/devops_cli/commands/ci.py","start_line":1836})
    61. search_code({"text":"shard_above_total"})
    62. search_code({"text":"\"docs\""})
    63. search_code({"text":"CHECK_ROW_NAMES"})
    64. search_code({"text":"_with_test_shard"})
    65. read_file({"end_line":120,"path":"tests/commands/test_ci_repeat.py","start_line":1})
    66. search_code({"text":"Changed-Test Independence"})
    67. list_files({"directory":"docs/commands"})
    68. search_code({"text":"timeout-minutes"})
    69. find_issues({"terms":"Changed-Test Independence"})
    70. read_issue({"number":4473})
    71. read_issue({"number":4722})
    72. read_issue({"number":6562})
    73. references({"name":"changed-tests"})
    74. references({"name":"Changed-Test Independence"})
    75. read_spec({"capability":"ci-test-shards","requirement":"The shards balance the recorded seconds"})
    76. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    77. search_code({"text":"no_testable_files"})
    78. search_code({"text":"def _resolve_test_targets"})
    79. list_files({"directory":"src/devops_cli/lang"})
    80. read_file({"end_line":60,"path":"tests/lang/test_language_catalogs.py","start_line":1})
    81. search_code({"text":"nothing to run"})
    82. search_code({"text":"no test file"})
    83. read_file({"end_line":2330,"path":"src/devops_cli/lang/en/messages.py","start_line":2280})
    84. search_code({"text":"changed-tests"})
    85. read_spec({"capability":"ci-job-time"})
    86. read_spec({"capability":"ci-test-shards"})
    87. read_file({"path":".github/workflows/ci.yml","start_line":740,"end_line":830})
    88. read_file({"path":"openspec/specs/ci-job-time/spec.md","start_line":145,"end_line":170})
    89. search_code({"text":"def shard_test_files"})
    90. search_code({"text":"_run_shuffled_repeats"})
    91. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2230,"end_line":2345})
    92. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":330,"end_line":420})
    93. read_file({"path":"tests/commands/test_ci_shard.py","start_line":1,"end_line":140})
    94. read_file({"path":"tests/commands/test_ci_repeat.py","start_line":100,"end_line":160})
    95. search_code({"text":"shard_above_total"})
    96. read_file({"end_line":1850,"path":"src/devops_cli/commands/ci.py","start_line":1815})
    97. read_file({"end_line":1900,"path":"tests/commands/test_ci.py","start_line":1845})
    98. list_files({"directory":"tests/commands"})
    99. list_files({"directory":"docs/commands"})
    100. read_file({"end_line":2320,"path":"src/devops_cli/lang/en/messages.py","start_line":2295})
    101. read_file({"end_line":1060,"path":"src/devops_cli/commands/ci.py","start_line":1030})
    102. list_files({"directory":"tests/ci"})
    103. search_code({"text":"Changed-Test Independence"})
    104. search_code({"text":"shard_paths"})
    105. search_code({"text":"shard_empty"})
    106. search_code({"text":"shard: str ="})
    107. read_file({"end_line":1022,"path":"src/devops_cli/lang/en/help.py","start_line":1004})
    108. search_code({"text":"Changed-Test Independence"})
    109. search_code({"text":"def test("})
    110. read_file({"path":".github/workflows/ci.yml","start_line":730,"end_line":840})
    111. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2270,"end_line":2350})
    112. read_file({"end_line":1860,"path":"src/devops_cli/commands/ci.py","start_line":1810})
    113. read_file({"end_line":2270,"path":"src/devops_cli/commands/ci.py","start_line":2235})
    114. read_file({"end_line":400,"path":"src/devops_cli/core/test_selection.py","start_line":330})
    115. read_file({"end_line":140,"path":"tests/commands/test_ci_shard.py","start_line":1})
    116. read_file({"end_line":1060,"path":"src/devops_cli/commands/ci.py","start_line":1035})
    117. read_file({"end_line":2320,"path":"src/devops_cli/lang/en/messages.py","start_line":2295})
    118. read_file({"end_line":1025,"path":"src/devops_cli/lang/en/help.py","start_line":1000})
    119. read_file({"end_line":1900,"path":"tests/commands/test_ci.py","start_line":1850})
    120. read_file({"end_line":140,"path":"tests/commands/test_ci_repeat.py","start_line":95})
    121. read_spec({"capability":"ci-test-shards"})
    122. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    123. read_spec({"capability":"ci-test-shards","requirement":"A sharded run reads and writes no cached verdict"})
    124. read_issue({"number":6562})
    125. read_issue({"number":4473})
    126. find_issues({"terms":"Changed-Test Independence"})
    127. read_issue({"number":4722})
    128. read_spec({"capability":"ci-job-time","requirement":"The test jobs skip the bytecode compile"})
    129. list_files({"directory":"docs/commands"})
    130. list_files({"directory":"tests/commands"})
    131. read_file({"end_line":1980,"path":"tests/commands/test_ci.py","start_line":1900})
    132. search_code({"text":"changed-tests"})
    133. search_code({"text":"CONST_CI_TEST_DURATIONS_PATH ="})
    134. search_code({"text":"CONST_TESTS_ROOT_DIR ="})
    135. search_code({"text":"shard_paths"})
    136. search_code({"text":"shard_empty"})
    137. search_code({"text":"CONST_CI_TEST_DURATIONS_PATH"})
    138. search_code({"text":"CONST_TESTS_ROOT_DIR"})
    139. search_code({"text":"changed-tests"})
    140. search_code({"text":"Changed-Test Independence"})
    141. read_file({"path":".github/workflows/ci.yml","start_line":745,"end_line":835})
    142. list_files({"directory":"tests/commands"})
    143. file_symbols({"path":"src/devops_cli/core/test_selection.py"})
    144. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":321,"end_line":390})
    145. list_files({"directory":"tests/roadmap/implement"})
    146. read_file({"end_line":2360,"path":"src/devops_cli/commands/ci.py","start_line":2280})
    147. read_file({"path":"tests/commands/test_ci_shard.py","start_line":1,"end_line":130})
    148. read_file({"end_line":1870,"path":"src/devops_cli/commands/ci.py","start_line":1800})
    149. read_file({"end_line":160,"path":"tests/commands/test_ci_repeat.py","start_line":90})
    150. read_spec({"capability":"ci-test-shards","requirement":"A sharded run reads and writes no cached verdict"})
    151. search_code({"text":"resolve_ci_cache_path"})
    152. search_code({"text":"shard_empty"})
    153. search_code({"text":"shard_above_total"})
    154. search_code({"text":" shard: str = ("})
    155. read_file({"path":"src/devops_cli/lang/en/help.py","start_line":1000,"end_line":1020})
    156. read_file({"end_line":2000,"path":"tests/commands/test_ci.py","start_line":1850})
    157. list_files({"directory":"docs/commands"})
    158. search_code({"text":"release-please--"})
    159. search_code({"text":"timeout-minutes"})
    160. search_code({"text":"workflows/ci.yml"})
    161. search_code({"text":".github/workflows"})
    162. search_code({"text":"CONST_CI_TEST_DURATIONS_PATH: Final[str]"})
    163. search_code({"text":"CONST_TESTS_ROOT_DIR: Final[str]"})
    164. search_code({"text":"name=\"docs\""})
    165. search_code({"text":"docs, \"check\""})
    166. search_code({"text":"commands/"})
    167. read_issue({"number":6562})
    168. read_issue({"number":4473})
    169. find_issues({"terms":"Changed-Test Independence"})
    170. search_code({"text":"ci_runs_main"})
    171. search_code({"text":"ci.yml"})
    172. search_code({"text":"workflows\" / \"ci.yml"})
    173. search_code({"text":"\"ci.yml\""})
    174. read_file({"end_line":140,"path":"tests/invariants/test_workflow_contracts.py","start_line":1})
    175. read_file({"end_line":790,"path":"tests/invariants/test_architectural_invariants.py","start_line":660})
    176. search_code({"text":"def _resolve_test_targets"})
    177. search_code({"text":"def _run_shuffled_repeats"})
    178. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    179. read_file({"end_line":2282,"path":"src/devops_cli/commands/ci.py","start_line":2240})
    180. search_code({"text":"[tool.pytest.ini_options]"})
    181. search_code({"text":"Changed-Test Independence"})
    182. search_code({"text":"def test("})
    183. read_file({"path":".github/workflows/ci.yml","start_line":740,"end_line":840})
    184. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2280,"end_line":2345})
    185. file_symbols({"path":"src/devops_cli/core/test_selection.py"})
    186. search_code({"text":"shard_above_total"})
    187. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":321,"end_line":390})
    188. read_file({"path":"tests/commands/test_ci_shard.py","start_line":1,"end_line":120})
    189. search_code({"text":"\"changed-tests\""})
    190. search_code({"text":"shards: str = ("})
    191. read_file({"path":"tests/commands/test_ci.py","start_line":1856,"end_line":1975})
    192. read_file({"path":"src/devops_cli/lang/en/help.py","start_line":1000,"end_line":1020})
    193. search_code({"text":"test_each_repeat_pass_runs_only_the_files_of_its_shard"})
    194. read_file({"path":"tests/commands/test_ci_repeat.py","start_line":100,"end_line":140})
    195. read_spec({"capability":"ci-test-shards"})
    196. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    197. search_code({"text":"CONST_CI_TEST_DURATIONS_PATH"})
    198. search_code({"text":"CONST_TESTS_ROOT_DIR: Final"})
    199. search_code({"text":"shard_paths"})
    200. search_code({"text":"shard_empty"})
    201. search_code({"text":"name=\"docs\","})
    202. search_code({"text":"docs generate"})
    203. read_file({"path":"tests/invariants/test_workflow_contracts.py","start_line":70,"end_line":110})
    204. list_files({"directory":"docs/commands"})
    205. read_file({"path":"tests/invariants/test_workflow_contracts.py","start_line":1,"end_line":75})
    206. search_code({"text":"def _resolve_test_targets"})
    207. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2101,"end_line":2135})
    208. read_issue({"number":4473})
    209. find_issues({"terms":"Changed-Test Independence"})
    210. search_code({"text":"test_test_selection.py"})
    211. search_code({"text":"test_roadmap_implement_amend.py"})
    212. read_spec({"capability":"ci-job-time","requirement":"The test jobs skip the bytecode compile"})
    213. read_file({"path":"tests/commands/test_test_selection.py","start_line":1,"end_line":12})
    214. search_code({"text":"Changed-Test Independence"})
    215. search_code({"text":"changed-tests"})
    216. read_file({"path":".github/workflows/ci.yml","start_line":740,"end_line":830})
    217. search_code({"text":"_run_shuffled_repeats"})
    218. search_code({"text":"shard_test_files"})
    219. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2250,"end_line":2345})
    220. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":320,"end_line":395})
    221. read_file({"path":"tests/invariants/test_workflow_contracts.py","start_line":1,"end_line":130})
    222. read_file({"path":"tests/commands/test_ci.py","start_line":1850,"end_line":1990})
    223. read_file({"end_line":860,"path":"src/devops_cli/commands/ci.py","start_line":800})
    224. read_file({"end_line":1860,"path":"src/devops_cli/commands/ci.py","start_line":1820})
    225. read_spec({"capability":"ci-test-shards"})
    226. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    227. read_spec({"capability":"ci-test-shards","requirement":"The test row runs one shard of the suite"})
    228. read_file({"path":"tests/commands/test_ci_shard.py","start_line":1,"end_line":70})
    229. read_file({"path":"tests/commands/test_ci_repeat.py","start_line":1,"end_line":140})
    230. search_code({"text":"job-total"})
    231. search_code({"text":"Changed-Test"})
    232. read_file({"path":"src/devops_cli/lang/en/help.py","start_line":1000,"end_line":1020})
    233. read_file({"path":"src/devops_cli/config/constants.py","start_line":755,"end_line":762})
    234. read_file({"path":"src/devops_cli/config/constants.py","start_line":2568,"end_line":2573})
    235. search_code({"text":"shard_empty"})
    236. read_file({"end_line":115,"path":"tests/commands/test_ci_shard.py","start_line":85})
    237. list_files({"directory":"docs/commands"})
    238. read_file({"end_line":2315,"path":"src/devops_cli/lang/en/messages.py","start_line":2300})
    239. read_spec({"capability":"ci-test-shards","requirement":"The workflow runs the test row in shards"})
    240. read_spec({"capability":"ci-test-shards","requirement":"The job Tests & Coverage aggregates the shards"})
    241. search_code({"text":"name=\"docs\""})
    242. search_code({"text":"docs generate"})
    243. read_spec({"capability":"docs-cli-reference"})
    244. read_file({"end_line":1060,"path":"src/devops_cli/commands/ci.py","start_line":1035})
    245. list_files({"directory":"tests/invariants"})
    246. search_code({"text":"workflows/ci.yml"})
    247. search_code({"text":"ALLOWED_JOB_PERMISSIONS"})
    248. search_code({"text":"permission"})
    249. search_code({"text":"actions: write"})
    250. read_file({"end_line":2050,"path":"tests/commands/test_ci.py","start_line":1990})
    251. search_code({"text":"startsWith(github.head_ref"})
    252. read_file({"end_line":780,"path":"tests/invariants/test_workflow_contracts.py","start_line":700})
    253. read_file({"end_line":830,"path":"tests/commands/test_ci.py","start_line":795})
    254. search_code({"text":"Changed-Test Independence"})
    255. search_code({"text":"changed-tests"})
    256. read_file({"path":".github/workflows/ci.yml","start_line":735,"end_line":830})
    257. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":300,"end_line":400})
    258. search_code({"text":"def test("})
    259. search_code({"text":"shard_test_files"})
    260. read_file({"path":"src/devops_cli/commands/ci.py","start_line":800,"end_line":870})
    261. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2270,"end_line":2360})
    262. read_file({"end_line":2272,"path":"src/devops_cli/commands/ci.py","start_line":2200})
    263. read_file({"end_line":1870,"path":"src/devops_cli/commands/ci.py","start_line":1800})
    264. read_spec({"capability":"ci-test-shards"})
    265. search_code({"text":"shard_above_total"})
    266. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    267. read_spec({"capability":"ci-test-shards","requirement":"The test row runs one shard of the suite"})
    268. search_code({"text":"shard: str = ("})
    269. search_code({"text":"_validate_ci_workflow_parity"})
    270. read_file({"path":"tests/commands/test_ci.py","start_line":1856,"end_line":1990})
    271. read_file({"path":"tests/commands/test_ci_shard.py","start_line":80,"end_line":130})
    272. read_file({"end_line":140,"path":"tests/commands/test_ci_repeat.py","start_line":100})
    273. read_file({"end_line":120,"path":"tests/invariants/test_workflow_contracts.py","start_line":30})
    274. search_code({"text":"def _resolve_test_targets"})
    275. search_code({"text":"devops docs generate"})
    276. read_file({"end_line":1025,"path":"src/devops_cli/lang/en/help.py","start_line":1005})
    277. search_code({"text":"CONST_CI_TEST_DURATIONS_PATH: Final"})
    278. search_code({"text":"CONST_TESTS_ROOT_DIR: Final"})
    279. list_files({"directory":"docs/commands"})
    280. search_code({"text":"shard_paths"})
    281. read_file({"end_line":40,"path":"tests/commands/test_ci_shard.py","start_line":1})
    282. search_code({"text":"### devops ci test"})
    283. search_code({"text":"--repeat"})
    284. read_file({"end_line":60,"path":"docs/commands/ci.md","start_line":30})
    285. search_code({"text":"ci --check --only docs"})
    286. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2101,"end_line":2140})
    287. search_code({"text":"Detect Changed Test Files"})
    288. search_code({"text":"Changed-Test Independence"})
    289. search_code({"text":"shard_test_files"})
    290. file_symbols({"path":"src/devops_cli/core/test_selection.py"})
    291. read_file({"path":".github/workflows/ci.yml","start_line":750,"end_line":835})
    292. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":320,"end_line":400})
    293. read_file({"end_line":2345,"path":"src/devops_cli/commands/ci.py","start_line":2250})
    294. read_file({"end_line":855,"path":"src/devops_cli/commands/ci.py","start_line":815})
    295. read_file({"end_line":1865,"path":"src/devops_cli/commands/ci.py","start_line":1815})
    296. read_file({"end_line":45,"path":"tests/commands/test_ci_shard.py","start_line":1})
    297. read_file({"end_line":140,"path":"tests/commands/test_ci_repeat.py","start_line":100})
    298. read_file({"end_line":1900,"path":"tests/commands/test_ci.py","start_line":1856})
    299. read_file({"end_line":1990,"path":"tests/commands/test_ci.py","start_line":1900})
    300. read_file({"end_line":120,"path":"tests/invariants/test_workflow_contracts.py","start_line":30})
    301. search_code({"text":"shard_paths"})
    302. search_code({"text":"def _collect_ci_workflow_run_steps"})
    303. file_symbols({"path":"src/devops_cli/core/test_selection.py"})
    304. search_code({"text":"shard_paths"})
    305. read_file({"path":"src/devops_cli/core/test_selection.py","start_line":320,"end_line":400})
    306. read_file({"path":"src/devops_cli/commands/ci.py","start_line":2240,"end_line":2400})
    307. read_file({"path":"src/devops_cli/commands/ci.py","start_line":1800,"end_line":1870})
    308. read_file({"end_line":850,"path":".github/workflows/ci.yml","start_line":740})
    309. read_file({"path":"tests/invariants/test_workflow_contracts.py","start_line":1,"end_line":170})
    310. search_code({"text":"_validate_ci_workflow_parity"})
    311. read_file({"path":"tests/commands/test_ci.py","start_line":1856,"end_line":1990})
    312. references({"name":"Changed-Test Independence"})
    313. references({"name":"changed-tests"})
    314. read_spec({"capability":"ci-test-shards"})
    315. read_file({"end_line":175,"path":"openspec/specs/ci-job-time/spec.md","start_line":130})
    316. read_spec({"capability":"ci-test-shards","requirement":"The test row runs one shard of the suite"})
    317. read_spec({"capability":"ci-test-shards","requirement":"Each shard collects only its own test files"})
    318. search_code({"text":"shard_above_total"})
    319. search_code({"text":"shards: str ="})
    320. search_code({"text":"def _resolve_test_targets"})
    321. search_code({"text":"Require Passing Test Shards"})
    322. search_code({"text":"job-total"})
    323. read_file({"end_line":300,"path":".github/workflows/ci.yml","start_line":120})
    324. read_file({"end_line":330,"path":".github/workflows/ci.yml","start_line":263})
    325. search_code({"text":"def resolve_step_rows"})
    326. search_code({"text":"def resolve_devops_argv"})
    327. read_file({"path":"src/devops_cli/commands/ci.py","start_line":1280,"end_line":1320})
    328. read_file({"path":"src/devops_cli/core/command_resolver.py","start_line":1,"end_line":130})
    329. search_code({"text":"resolve_devops_argv"})
    330. search_code({"text":"test_every_devops_command_the_workflows_actions_and_hooks_run_resolves"})
    331. read_file({"end_line":470,"path":"tests/invariants/test_workflow_contracts.py","start_line":330})
    332. read_file({"end_line":1530,"path":"tests/commands/test_ci.py","start_line":1470})
    333. search_code({"text":"5 min + 1 min"})
    334. search_code({"text":"rule 5"})
    335. search_code({"text":"docs/commands/ci.md"})
    336. search_code({"text":"def _docs_check"})
    337. search_code({"text":"\"docs\""})
    338. read_spec({"capability":"ci-test-shards","requirement":"A sharded run reads and writes no cached verdict"})
    339. read_spec({"capability":"ci-test-shards","requirement":"The shards balance the recorded seconds"})
    340. callers({"symbol":"record_passing_run"})
    341. callers({"symbol":"get_ci_cache"})
    342. search_code({"text":"record_passing_run"})
    343. search_code({"text":"_load_workflow(WORKFLOWS_DIR / \"ci.yml\")"})
    344. search_code({"text":"ci.yml\")[\"jobs\"]"})
    345. read_file({"end_line":172,"path":"docs/adr/0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md","start_line":155})
    346. read_file({"end_line":1050,"path":"src/devops_cli/commands/ci.py","start_line":1035})
    347. read_file({"end_line":860,"path":"src/devops_cli/commands/ci.py","start_line":805})
    348. read_file({"end_line":2040,"path":"tests/commands/test_ci.py","start_line":1984})
    349. list_files({"directory":"docs/commands"})
    350. list_files({"directory":"tests/roadmap/implement"})
    351. search_code({"text":"def shard"})
    352. search_code({"text":"shard_test_files"})
    353. read_file({"end_line":270,"path":"tests/commands/test_ci_shard.py","start_line":130})
    354. read_file({"end_line":300,"path":"tests/invariants/test_workflow_contracts.py","start_line":160})
    355. search_code({"text":"in a 'run'"})
    356. read_file({"end_line":700,"path":"tests/invariants/test_workflow_contracts.py","start_line":560})
    357. search_code({"text":"has no permissions"})
    358. search_code({"text":"timeout-minutes"})
    359. read_file({"end_line":2160,"path":"src/devops_cli/commands/ci.py","start_line":2101})
    360. list_files({"directory":"tests/docs"})
    361. search_code({"text":"docs check"})
    362. read_spec({"capability":"ci-test-shards","requirement":"The job Tests & Coverage aggregates the shards"})
    363. read_spec({"capability":"ci-test-shards","requirement":"The workflow runs the test row in shards"})
    364. search_code({"text":"timeout = "})

    Tool calls: callers=2 (empty=0), file_symbols=5 (empty=0), find_issues=4 (empty=0), list_files=17 (empty=0), read_file=137 (empty=0), read_issue=9 (empty=0), read_spec=36 (empty=0), references=5 (empty=0), search_code=149 (empty=17)

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

    The plan request held these comments of the item whole: #6564 (comment), #6564 (comment).

  9. added
    owner/service
    and removed
    owner/service
    on Nov 20, 2026
  10. 4 remaining items

  11. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failed check: pytest on base: tests/commands/test_ci_shard.py.

    Failure class: test.
    Action taken: none.
    Action left: repair: give the failure to a fix step.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 1002669/10114 pytest on base: tests/commands/test_ci_shard.py

    Reason:

    The tests of tests/commands/test_ci_shard.py could not run on the base commit. Pytest exited with status 1.
    /app/.venv/bin/python: No module named pytest
    

    Last message of the agent (a claim that no check verified): Group 1 is done and committed (0693b1136), with both tasks ticked. What I changed - tests/commands/test_ci_shard.py: added test_shard_paths_puts_each_given_file_in_one_shard (the named failing case: a small tree with a duration record, each given file in exactly one shard, heaviest given file to the lightest shard) plus test_shard_paths_weighs_a_given_file_that_the_tree_does_not_hold_at_no_second for the missing-file rule, and imported shard_paths. - src/devops_cli/core/test_selection.py: added shard_paths(shard, shards, modules, root) — each module weighs its recorded seconds of CONST_CI_TEST_DURATIONS_PATH, a module with no record its lines at the recorded seconds per line of the list, a module the tree does not hold 0 seconds; heaviest first to the shard with the least weight, tie to the lower shard, returning the sorted paths of shard shard. Added the private _module_lines helper and made shard_test_files delegate with directory_modules(CONST_TESTS_ROOT_DIR, root), so the whole-suite split keeps its weights and each module stays in one shard. Verification results - uv run devops ci test tests/commands/test_ci_shard.py on the base (before the code change): failed at collection with ImportError: cannot import name 'shard_paths' — the right reason. - uv run devops ci test tests/commands/test_ci_shard.py: 24 passed (including the pre-existing whole-suite shard cases, which pin that the delegated split is unchanged). - `uv run devops ci te

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

    The job kept 1 work-in-progress commit on the branch ci/6564-changed-test-independence-times-out-on on origin. The last is 0693b11361fd07838d84a426b7b73a3800308ae3. The job discarded only the work after it. The next run continues from it and does the tasks that are not ticked.

  12. added
    status/blocked
    and removed
    status/in-progress
    on Nov 21, 2026
  13. added
    owner/agent
    on Nov 21, 2026
  14. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    Owner decision (2026-11-21, a direct answer): "Accept, document limit".

    • Each repeat run on workers uses --dist loadfile, so a changed file runs whole in one worker, in its shuffled order. A probe of one file of 60 tests with an order-dependent pair failed on 11 of 24 seeds with one process, on 0 of 24 with --dist worksteal and on 11 of 24 with --dist loadfile.
    • Above 50 changed tests, the check does not catch a leak from one changed file into another changed file that runs on another worker. A probe of 8 files with a leak between two of them failed on 14 of 24 seeds with one process, and on 0 of 24 on 4 workers with either mode. One serial pass of the 1,473 changed tests of feat(roadmap): end the implement Job at the draft pull request #6562 took 454 s, so a serial pass cannot fit the 5 min + 1 min limit.
    • A run of 50 tests or fewer keeps one process and full coverage.
  15. added
    status/in-review
    and removed
    status/blocked
    on Nov 21, 2026
  16. removed
    status/in-review
    owner/agent
    on Nov 21, 2026
  17. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor
  18. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-21 07:05 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalsource/agenttype/infravalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions