Skip to content

ci: the determinism job can be the longest job in a ready confirmation and hold the merge lease #4137

Closed

Description

@schlessera

Context

#4109 added the determinism job, which reruns a PR's changed Bun test files under CPU load at every pull-request cadence, including ready confirmation. #4108 cut ready confirmation's unit jobs to shorten the merge lease.

In the first confirmation that ran both (run 44017250694, PR #4134), determinism was the longest job:

Job Duration
determinism 1,236 s
slowest unit partition (of eight) 979 s
other unit partitions 608–821 s

The lease for that confirmation was held from 04:25:44 to 04:50:40 UTC, about 25 minutes, the same as before #4108. That PR changed many test files, so it is close to a worst case; a PR that changes one or two test files spends far less. But the job's budget (600 weighted seconds, observed at about 3.2 times that in wall time under load, #4117) allows it to exceed the slowest unit partition on any PR that changes enough tests.

The same files were already repeated on the PR's draft head: determinism runs at draft cadence too. Ready confirmation repeats them again while the lease is held.

Scope

Decided (maintainer, 2026-11-17): fewer repetitions at ready confirmation.

  • Ready confirmation runs the floor of two repetitions. Drafts, ready feedback and draft heavy feedback keep five.
  • One owner in scripts/test-determinism.ts decides the count per cadence; the hosted determinism command reads it.
  • Record the ruling in docs/decisions/ci-utility.md under "Changed tests repeat under load", and correct docs/process/testing.md and docs/process/test-authoring.md.

Out of scope

Acceptance criteria

  • The hosted determinism command for a confirmation plan asks for two repetitions, and for draft, feedback and feedback-heavy plans keeps the default. A test shown failing first.
  • A mutation that keeps the default at confirmation fails that test.
  • The PR's own ready confirmation shows the job running two repetitions, with its duration recorded beside the 1,236 s above.

Verification

  • bun run check:pr --base origin/main.
  • The PR's ready confirmation.

Contract impact

None. CI tooling only.

2026-11-17: the options section was replaced by the maintainer's ruling; the comment below records it and the estimates behind it.

Activity

  1. added
    type: chore
    area: ci
    needs: decision
    on Nov 17, 2026
  2. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-17): fewer repetitions at ready confirmation. Drafts, ready feedback and draft heavy feedback keep five repetitions; ready confirmation runs the floor of two.

    What it implies:

    • One owner decides the count per cadence, and the hosted determinism command for a confirmation passes it.
    • The accepted cost is a weaker check on the exact head that merges. The draft head has normally run the same files five times already.
    • Declined: splitting the selection across runners (more runners and more planner, aggregate and lint code) and reusing the draft result (an input-reuse rule of the kind ci: retire browser proof retention and its audited source pins #4107 retired). Leaving it unchanged was also declined.

    Basis for the choice, estimated over the 150 most recent merges with the reviewed weights and the one observed load ratio (about 3.2): 39 changed no Bun test file; for the rest the job's median was about 5.5 minutes; about 17 would have run longer than the slowest unit partition at five repetitions. These are estimates, not measurements.

  3. added
    agent-ready
    priority: p2
    and removed
    needs: decision
    on Nov 17, 2026
  4. added this to the 0.45.0 milestone on Nov 17, 2026
  5. self-assigned this
    on Nov 17, 2026
  6. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-a00a478a. Branch: chore/4137-determinism-confirmation-reps.

    none

  7. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Delivered by #4143 (squash eb9191c4b). The PR's own ready confirmation, run 44036241499, ran the job at the floor:

    • determinism: 193 s whole job; "Repeating 1 changed Bun test file(s) 2 time(s) each under 4 CPU burner(s)", 20.8 s of repetition under load. The rest of the job is checkout, runtime setup and the build.
    • unit: 660–891 s across eight partitions.
    • Lease held from 07:06:56 to 07:24:52 UTC, about 18 minutes.

    This is not a like-for-like comparison with the 1,236 s in run 44017250694: that PR changed many test files and this one changed one. It shows the count is applied at confirmation and what the job's fixed cost is (about 170 s). The effect on a test-heavy PR is still an estimate until one confirms.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: cipriority: p2type: chore

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions