Repository navigation
fix(ci): shard lifecycle smoke without weakening its gate - #3345
Conversation
Delegate two-way balancing to pytest-split while retaining complete xdist affinity units, the existing marker selection, four workers and ten-minute job caps. Require both explicit shard results under the existing check name and use the clean Python-module pytest entrypoint. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 067b35fc-52fb-4db4-b316-c606d23b4b34
There was a problem hiding this comment.
🔵 Needs a closer look
Human review should confirm successful hosted runs of both shards within their unchanged 10-minute limits before approving this required-gate scheduling change.
No open issues 🎉
What changed in this PR
This PR addresses lifecycle smoke timeouts by splitting the existing required test selection into two parallel shards while preserving test coverage, worker affinity, and the required check name.
Changes:
- Adds affinity-preserving two-way sharding, retaining four workers and a 10-minute limit per shard.
- Converts
Lifecycle Smoke (Linux)into an always-run aggregate that succeeds only when both shards succeed. - Adds partition, startup, and gate contracts, and documents the updated local commands.
| File | Description |
|---|---|
tests/unit/scripts/test_lifecycle_smoke_sharding.py |
Tests affinity preservation, partition validation, and selector handling. |
tests/quality/test_ci_topology.py |
Verifies shard coverage, clean plugin loading, workflow constraints, and aggregate failure behavior. |
scripts/lifecycle_smoke_sharding.py |
Implements two-way balancing without splitting composite affinity groups. |
docs/src/content/docs/contributing/integration-testing.md |
Documents sharding, timeout limits, aggregate behavior, and local execution. |
.github/workflows/ci.yml |
Adds two shard jobs with shared steps and preserves the required aggregate check. |
Review effort: Balanced
Docs sync advisoryVerdict: no_change * Pages affected: 0 * LLM calls: 1/15 * Took: not measured No additional product-documentation changes indicated. At This is the deterministic path-gate result, not a whole-corpus audit or a documentation-panel review. No panel or companion PR was spawned; the advisory does not establish CI readiness. Generated by docs-sync. This comment is AI-generated and may contain errors. |
Merge Master assessmentRecommendation: ship_now for exact head The five-path scheduling change preserves the full lifecycle selection, affinity groups, four workers per shard, unchanged ten-minute limits, and the strict required aggregate. Existing independent source review and entrypoint rereview have no outstanding findings. The current-head Copilot review has no inline defects; its request for successful hosted jobs below ten minutes is satisfied by both completed jobs. Exact-head CI run 39747693143 and required gate 39747693381 succeeded. Lifecycle shards completed successfully in 243s and 385s; their strict aggregate succeeded in 4s. All 27 raw checks are terminal: 24 success, two neutral, one skipped deployment. Hosted evidence is 396 passed / 13 skipped; distinct clean local evidence is 394 passed / 17 classified skips across 411 unique identities. The actual full-selection union guard, 145 quality cases, causal failures/restorations, canonical lint/static evidence, and all 38 sealed artifacts remain source-bound and unchanged; no tests or reviewers were replayed merely for this handoff. Canonical completion-schema and strict terminal owner-v2 evidence are verified, with zero detected registered-owner touches. Fresh actual-main composition matches the qualified head tree Fresh API reads confirm restored ADMIN and applicable ruleset bypass eligibility Landing this scheduling prerequisite does not complete CI recovery or establish full actual-main validation. #3343, #3344, and #3346 need their own current-head qualification after consuming the actual public landing; source owners retain those duties. Full nonpublishing platform/integration/release validation remains open and belongs to the sole CI owner after the repaired public landings. Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
fix(ci): shard lifecycle smoke without weakening its gate
Description
TL;DR
Split the existing required lifecycle selection into two affinity-preserving jobs, each retaining four
loadgroupworkers and its 10-minute whole-job limit. Keep the required check name Lifecycle Smoke (Linux) as an always-run aggregate that accepts only two explicit successful shard results. This is a scheduling-only correction; application behavior, selected tests, credentials, release triggers, and merge-gate requirements are unchanged.Important
Hosted branch qualification is complete at the exact head below. This PR is not yet landed and does not establish repaired main CI or authorize any release, publication, deployment, or full release-validation dispatch.
Problem (WHY)
396 passed, 13 skipped in 577.92swas followed by cancellation, and the required aggregate correctly failed.pytest -p scripts.lifecycle_smoke_shardingcannot import the repository-only plugin in a clean environment. This was reproduced asImportError: Error importing plugin "scripts.lifecycle_smoke_sharding": No module named 'scripts', then corrected topython -m pytest.The evidence boundary follows "Read agent execution traces, not just final outputs.": a printed test summary is not a successful terminal job, and an observer's
PYTHONPATHis not a clean-runner startup proof.Approach (WHAT)
tests/integrationroot.xdist_groupaffinity units, delegate balancing to the existing pytest-splitLeastDurationAlgorithm, then expand those units without reordering members.loadgroup, and a 10-minute limit per job.success; reject missing, failed, cancelled, and skipped results.python -m pytestand pin that entrypoint in the topology contract.Implementation (HOW)
.github/workflows/ci.ymlscripts/lifecycle_smoke_sharding.pytests/unit/scripts/test_lifecycle_smoke_sharding.pytests/quality/test_ci_topology.pydocs/src/content/docs/contributing/integration-testing.mdDiagrams
The highlighted region shows the new parallel jobs and their explicit results feeding the unchanged required check name.
sequenceDiagram participant C as ci.yml participant A as lifecycle-smoke-shard-1 participant B as lifecycle-smoke-shard-2 participant G as Lifecycle Smoke (Linux) rect rgb(255, 247, 200) Note over A,B: NEW two shards, same selection and complete affinity groups par Shard 1 C->>A: python -m pytest, lifecycle-shard 1 A->>A: 4 workers, loadgroup, 10-minute job cap and Shard 2 C->>B: python -m pytest, lifecycle-shard 2 B->>B: 4 workers, loadgroup, 10-minute job cap end A-->>G: explicit shard 1 result B-->>G: explicit shard 2 result Note over G: always(), unchanged required check name alt Both results are success G->>G: Exit 0 else Either result is not success or is absent G->>G: Exit 1 end endTrade-offs
Benefits
home_envcases stay in one shard and one worker; composed affinity labels are also covered.successplussuccess.Issue and approved scope
Issue: related tracking #3341, which remains OPEN.
Human scope-approval comment: no new public approval comment was created. The maintainer directly authorized these bounded CI fixes and explicitly waived a separate issue/public-approval-record prerequisite:
This task-specific exception is not a fabricated accepted label or a claim that the earlier label-gated worker admission passed. Scope is the five-file scheduling correction only; public-main repair and full nonpublishing validation remain outstanding.
Type of change
Testing
Validation
Base: freshly fetched and composed
75bfa523954dabb3eb9bbd57f4b6bd4eacf3c389. Qualified head:f2cefd811a4cc3d8cbeca9a4849c5107d01c2239. Full repository suites and repaired-main/full-release validation are not claimed.Hosted pytest results: shard 1 200 passed, 5 skipped in 219.15s; shard 2 196 passed, 8 skipped in 319.11s. These account for all 409 hosted cases, distinct from the 411-case local selection.
The exact-head rollup is 22 SUCCESS, 2 NEUTRAL, 1 SKIPPED. The neutral CodeQL compatibility context is not a passed imposed-native CodeQL check; the actual Python/actions analyses succeeded separately. Deployment was skipped. GitHub still reports
MERGEABLE/BLOCKED; landing remains the separate Merge Master decision.Exact local commands and results
The shared two-slot validator serialized all pytest qualification.
proofnames the local evidence directory:Each actual shard ran sequentially with the following command, for
shard=1thenshard=2; neitherPYTHONPATHnor an observer plugin was present:Skips: four case-insensitive-filesystem cases, twelve native-Windows-capability cases, and one explicitly network-gated marketplace case. All 411 local cases are accounted for; the older hosted Linux run had 409 cases, not 411.
Full current lint mirror, with the new script additionally included:
All commands exited 0. Output excerpts:
The workflow-equivalent YAML-I/O, portable-relative-path, and 2100-line guards also passed: 507 source files and 592 length-covered files.
Finite in-memory mutations produced the intended failures: affinity removal 4 failed/15 passed; overlap acceptance 1 failed/18 passed; missing-node acceptance 1 failed/18 passed. Source bytes were never mutated; restoration initially passed 143 tests, then the final entrypoint correction passed 145. Historical mock-fixture failures and the clean-console startup failure are retained, not recast as successes.
The independently reviewed diff is
7b1e47993c3ecde210fcdc1521aa13d520127d6abfcaa80da40f0ac2e04ea2d8. Clean-execution reconciliation is5a7e2986c62d7f0f2a879145fabded87b2b6c082d10ec2c930eb1f28c6cd4b1f: exact JUnit node multisets match the separately observed worker collections. Independent review used read-only file/Git inspection, not another validator.Scenario Evidence
tests/quality/test_ci_topology.py::test_lifecycle_shards_collect_exact_required_union; actual shard JUnit reconciliation (regression-trap for the #3341 recovery scheduling boundary)tests/unit/scripts/test_lifecycle_smoke_sharding.py::test_partition_retains_every_node_once_and_whole_affinity_groups; actual 17-casehome_envworker tracetests/quality/test_ci_topology.py::test_lifecycle_smoke_is_required_and_hermetic;test_lifecycle_aggregate_cannot_ignore_either_shardtests/quality/test_ci_topology.py::test_lifecycle_shard_command_drift_fails; clean-environment collection and both actual module-entry shard runsHow to test
uv sync --frozen --extra dev, then the unit/quality command above; expect no failures.APM_E2E_TESTS=1; retain the original marker expression and inspect platform/prerequisite skip reasons.Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual in the
development guide:
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.
Co-authored-by: Copilot [email protected]