Skip to content

ci(ordering): shard the project ordering leg and cache the tier guard's workflow parse (#2254) - #2258

Merged
JarryShaw merged 1 commit into
mainfrom
ci/2254-shard-project-ordering
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/2254-shard-project-ordering

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — CI configuration

Description

Closes #2254, per the ruling: B plus C, and a review for duplicated tests.

  • B, shard:
    • Split: util/run_unittest_leg.py holds SHARD_BOUNDARIES = {'project': 'test_q'} and takes --half 1|2. unittest-ordering's project cell becomes project (half 1) and project (half 2).
    • Docs-only path: project-tests splits its one step into two, in the same job, at the same boundary. Its leg ran near its 15-minute cap.
    • Guard: test_unittest_ordering_shards.py checks that both sites cut at the one boundary, that the halves are disjoint and cover the unsharded leg, and that a new module lands in exactly one half.
    • Root-level modules: both halves run them, as every leg does (test: three modules pass alone but fail together, and pytest reports it green #981).
  • Required checks: unchanged. The project-tests job keeps its id and name, and unittest-ordering is not required. util/ci_timing.py keys on no renamed step.
  • C, tier guard: WorkflowAgreementTests launched a fresh interpreter per selector call, asking the same selectors repeatedly. The test stub now replays a selector's output from a per-class cache. A different selector, or a failed run, still runs for real. No assertion changes. Locally it drops from 55.6 s to 21.8 s.
  • Duplicates: an AST comparison of test bodies across tests/project and the tier guard finds no true duplicate. Shared bodies read different inputs. Nothing is removed.
  • Fail-on-main: the new tests give 5 failures and 3 errors (no attribute 'SHARD_BOUNDARIES', no step named 'Run the first half of …').
  • Tests: 46 workflow-reading tests/project modules plus the root guards give 1043 passed. actionlint is clean.

@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
…'s workflow parse (#2254)

Problem: the `Plain unittest ordering (project)` run step reached a p90 of
11.8 of its 20 minutes and was on course to hit the cap in about a week;
`project-tests` runs the same leg on a docs-only diff under a 15-minute
cap; and tests.test_tier_guard's WorkflowAgreementTests reran the same two
tier selectors in a fresh interpreter seven times, about 7 s each.

Fix:
- B: util/run_unittest_leg.py takes --half 1|2, cut at the one name
  SHARD_BOUNDARIES holds for tests/project (test_q); the unittest-ordering
  matrix runs `project (half 1)` and `project (half 2)`, and project-tests
  runs its docs-only unittest step as two steps, one per half, in the same
  job. --before/--from cut at any other name by hand.
- C: the tier guard's python stub replays a `-c` selector's output from a
  per-class cache once it has run it for real; a doctored step that asks
  something else, or a failing run, is not served from it.
- Consolidation: no clear duplicate found; nothing removed.

Tests: test_unittest_ordering_shards checks the cells and the project-tests
steps cut at one boundary and cover the leg once; test_project_pins_once_1954
and test_unit_tests_queue read the new cells and steps; a new PythonStubTests
case pins the cache. Workflow readers, tier guard and docstring contract:
1043 passed. actionlint clean.
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at 952d434d1 (Sonnet: a full review of c31e8ccf4, a delta review of 2eaef1f55, and the last nit applied).

  • Shard: the full project leg splits 100/45 of 145 modules at test_q. The halves are disjoint, and their union is the unsharded leg. --half with --before or --from is refused.
  • Required checks: unchanged. The only old step name left is in the frozen ci_timing_fixtures copy. util/ci_timing.py keys on no renamed step.
  • Tier guard: no assertion changed. A different selector, or a failed run, still runs for real. WorkflowAgreementTests drops from 55.6 s to 21.8 s.
  • Duplicates: an AST check of the bodies finds no true duplicate. The five shared bodies read different inputs.
  • Round 1 fixes: STALL_DUMP_ENV's doc comment is restored. Timings and counts are out of the prose, and the change-relative messages and comment are reworded.
  • Fail-on-main: 5 failures, 3 errors (no attribute 'SHARD_BOUNDARIES', no step named 'Run the first half of …').
  • Tests: the five targeted files give 222 passed. actionlint is clean.

@JarryShaw
JarryShaw force-pushed the ci/2254-shard-project-ordering branch from 2eaef1f to 952d434 Compare October 26, 2026 15:58
@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, 952d434d1, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 3023 23 1044 25 98.82%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17434 218 4584 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at 952d434d1. Closes #2254.

  • Review: Sonnet GOOD TO GO after one round, the timings and change-relative wording.
  • CI: all checks complete, Required checks passed SUCCESS, 0 failed.
  • KTLO: 12 legs, no warnings.
  • Ordering: merged into main and run, unsharded. project leg: 2402 tests, 0 failures. The two halves first run as CI cells on main after merge.
  • Conflicts: none against the current main.

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

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci(timing): the project ordering leg will hit its 20-minute step cap within about a week

1 participant