Skip to content

Reduce CI queueing and runtime without cancelling release publication #725

Closed

Description

@JacobStephens2

From the Oct 11–16 2026 Run retrospective, finding 5. Tracking issue: #721.

The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.

Requested outcome and validation

Cancel superseded pull-request runs in CI and Release using workflow/branch-specific concurrency groups, while preserving independent branches and tag/main publication. Reduce unnecessary Release work on PRs whose changed paths cannot affect release artifacts. Account for generated cargo-dist workflow ownership and branch-protection required checks before adding path filters: skipped required checks must not strand PRs.

Profile the slow macOS shard and convert repeated end-to-end table cases to tests at an in-process seam, retaining representative end-to-end coverage for each behavior. Add nextest slow-test reporting with a justified threshold; flag regressions without hiding failures or adding indiscriminate retries.

Measure queue time and execution time before/after, verify shard coverage remains complete, and verify superseding a PR frees runners without cancelling a tag release. Link follow-up performance work to #570 and the completed #174 baseline rather than assuming the old targets still describe this host.

Current checkout check: neither workflow has a concurrency block; Release runs on every PR and is generated by cargo-dist; no .config/nextest.toml is present. The report's estimated savings require measurement.

Original finding, including evidence, proposed fixes, and confidence

5. CI takes 25–40 min a cycle, and a third of that is queueing (Repo)

  • Evidence: in Check re-run reads CI as passed before the re-run's checks are listed, and Self-merges red CI #686, 29 of the 69 CI-wait minutes were spent queueing for macOS runners.
    • Each push needs 5 macOS jobs: four test-macos-shard jobs plus Release's aarch64 build. At most 5 ran at once.
    • Superseded runs keep their runners. Check re-run reads CI as passed before the re-run's checks are listed, and Self-merges red CI #686's first CI kept running 10 min after Delivery pushed a new head.
    • Neither ci.yml nor release.yml has a concurrency block, and release.yml builds a macOS artifact on every PR.
    • The long-pole shard holds 420 tests and takes 1,107 s. 23 tests of 60 s or more make up 23% of the suite. Examples: unauthenticated_public_publishers_…_with_every_harness takes 346 s, and the 11×2 final-line table in tests/security_review.rs:400 runs each case as a full Scenario.
  • Fix:
    • concurrency: {group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}, cancel-in-progress: ${{ github.event_name == 'pull_request' }}} in both workflows.
    • A paths: filter on release.yml's pull_request trigger.
    • Move table-driven cases in-process and keep one or two end-to-end cases per behaviour.
    • A nextest slow-timeout in .config/nextest.toml to flag new slow tests.
  • Confidence: high that cancelling frees runners; medium on the minutes saved.

Activity

  1. added
    enhancement
    needs-triage
    on Oct 17, 2026
  2. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: Reduce redundant CI work and measured test runtime while preserving release publication.

    Current behavior:
    Superseded PR workflows are not cancelled. Release runs on every PR through generated configuration. Four macOS test partitions provide a stable aggregate check, and there is no dedicated slow-test reporting configuration. The retrospective timing estimates have not been independently remeasured.

    Desired behavior:
    Cancel superseded runs of the same workflow for one PR while retaining independent PRs, branches and release publications. Reduce release work for changes that cannot affect artifacts only when required-check consumers remain satisfied. Profile the expensive test cases and move repeated table scenarios to an appropriate in-process seam, retaining representative end-to-end behavior. Report slow tests without hiding failures or adding blanket retries. Respect the release workflow generator’s ownership.

    Key interfaces:

    • Workflow concurrency identities, pull-request events and tag publication events.
    • cargo-dist configuration/generation and branch-protection/ruleset required-check consumers.
    • macOS partition coverage and stable aggregate checks.
    • Test seams, representative end-to-end cases and nextest reporting.

    Acceptance criteria:

    • Two pushes to one PR cancel only superseded runs of the same workflow; different PRs and tag releases remain independent.
    • Tag publication cannot be cancelled by a PR update, and release smoke/publication dependencies remain intact.
    • Any reduction in PR Release work accounts for all required-check consumers; if safe filtering cannot be established, preserve the check contract and document the blocker rather than strand PRs.
    • Generated Release changes are reproducible from its owning configuration or a supported generation extension.
    • Profile representative slow cases and record before/after queue time and execution time; distinguish measured results from historical estimates.
    • Refactored table cases preserve each acceptance behavior, retain representative end-to-end coverage, and leave partition coverage and aggregate failure/cancellation handling complete.
    • Slow-test reporting uses a justified threshold and continues to expose failures; avoid indiscriminate retries.

    Out of scope:

    • Changing release artifacts, supported platforms, publication policy or required-check protection settings.
    • Assuming a fixed percentage of improvement or blanket rewriting of the test suite.
    • Host scheduler changes and unrelated local build-cache policy (Benchmark safe build-cache reuse across Run worktrees #733).
  3. added
    ready-for-agent
    and removed
    needs-triage
    on Oct 17, 2026
  4. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Fresh measurements: 0.11.3 release waiting on main

    Observed at 2026-10-17 03:28 UTC, on main commit a9e2d5353812ec3a6d6caefaa0c72838d79cfeb2.

    Current CI run was created at 02:35:35 UTC. Linux finished successfully in 9.4 minutes; site tests passed. The release is waiting for the remaining macOS shards.

    Job Workflow creation to runner start Execution elapsed Status
    test-macos-shard (4) 16.2 min 10.7 min success
    test-macos-shard (3) 38.1 min 14.7 min in_progress
    test-macos-shard (2) 34.2 min 11.3 min success
    test-macos-shard (1) 39.0 min 13.9 min in_progress

    The start delay uses workflow creation as the common baseline. These macOS matrix jobs have no dependency gate; this is an approximate queue/startup measurement, not a claim about the scheduler internals. Execution elapsed for a running job is not its final duration.

    Previous successful main CI took about 54.4 minutes overall. Its macOS shards waited 7.2, 25.5, 28.2 and 39.9 minutes to start, then executed for 14.3, 16.4, 14.0 and 14.3 minutes respectively. The repeated long initial waits are direct evidence of queueing; these observations do not establish a new test-runtime regression.

    Current workflow inspection confirms four macOS partitions and a stable aggregate check, with no concurrency group in CI or Release. Release also runs on PRs. The macOS sharding improvement already exists; the remaining queueing work in this issue is still relevant.

    During this release wait, superseded main CI runs and CI runs for already merged PRs #741 and #742 were cancelled. The queueing above persisted, so these cancellations alone do not establish a fix or a measured savings estimate. Other PR workflows remained active; their contribution and hosted-runner capacity limits need measurement rather than assumption.

    This supports the existing enhancement / ready-for-agent brief. No duplicate issue or label change is needed. Preserve required-check coverage and tag publication when implementing concurrency or filtering; do not bypass release checks to shorten this wait.

  5. added
    in-progress
    and removed
    ready-for-agent
    on Oct 17, 2026
  6. removed
    in-progress
    on Oct 17, 2026
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions