Skip to content

fix(ci): bound Nextest shard discovery before running tests (#14906) - #15441

Draft
EffortlessSteven wants to merge 3 commits into
mainfrom
fix/14906-bounded-nextest-discovery
Draft

EffortlessSteven wants to merge 3 commits into
mainfrom
fix/14906-bounded-nextest-discovery

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Problem

In queue run 44576937506, shard 1 retained a complete 15,776-line partition list but no complete independent full list. Test execution never started. The existing 40-minute test step also owns both discovery commands, so the phase was invisible until cancellation. Advances #14906.

Change

  • Bound partition and independent full discovery separately, with phase-tagged failure, elapsed time, child exit and stderr byte-count metadata. No child stderr payload or diagnostic command line is uploaded. A list is canonical only after successful nonempty discovery and evidence publication.
  • Stop on failed/cancelled discovery; do not run tests, reuse a partial list, synthesize JUnit, or use the shard union as the full inventory. Existing verifier and test/JUnit contracts are byte-unchanged. No runner or permission changes.
  • Proposed 480 seconds per discovery phase, above the observed 366-second listing and consistent with sampled whole test-step times. It is not a worst-case execution/upload reserve or hosted timing result.

Evidence and remaining gates

  • Parent d37e66b646839f29f70f6d9f8f9988017fd2a779, tree 50f38ff3b6cb3e153ae0a5118a71dcd8ba3489a2; reviewed patch SHA-256 a9181f1022144adaafb266d7c88e0895f38639fb818cf1b2fb497d1d4d6d9636.
  • Independent detached replay: all 26 fixture controls passed, including exact workflow-block cases and TERM/INT during discovery, process acquisition and publication. They did not start real Nextest, a workspace build, or hosted CI.
  • Run actionlint and native Rust formatting, file/process policy and the narrow repo-policy target on the exact integrated head.
  • Review initial budgets and qualify through the existing CI path after preflight; keep the draft unqueued until then. No manual run or retry requested.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 148 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 9e893eb6-128f-4193-b5dd-58b6c60774a3
Commits

Reviewing files that changed from the base of the PR and between d37e66b and c69205c.

Files selected for processing: 10

  • .github/workflows/rust-test-shards.yml
  • changelog.d/14906-bounded-nextest-discovery.md
  • policy/non-rust-allowlist.toml
  • policy/process_allowlist.d/14906-nextest-discovery.txt
  • tools/ci/README.md
  • tools/ci/nextest-discovery.py
  • tools/ci/test_nextest_discovery.py
  • tools/repo-policy/tests/nextest_discovery.rs
  • xtask/src/main.rs
  • xtask/src/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Copy link
Copy Markdown
Member Author

Exact published head fc6ca1290b9092e47596ed80fce564ae7d7298ef / tree 50f38ff3b6cb3e153ae0a5118a71dcd8ba3489a2 preflight: repo-pinned jactionlint passed on the changed workflow; workspace cargo fmt --check passed; native repo-policy --test nextest_discovery ran one test (all 26 fixture controls) and passed; native repo-policy check-workflows passed. Exact file/process registration shape/counts also pass a static check, which is not the native xtask policy result. Native xtask file/process/covered-by and hosted qualification remain pending; no rerun or dispatch.

Copy link
Copy Markdown
Member Author

One measured execution-budget reference for the existing #14906 owner: on the same historical run where shard 1 timed out in discovery, healthy shard 2 passed 15,868 tests in 908.830 s (4 slow) and took 15m18s for combined listing/execution. That is not healthy shard-1 evidence or a guarantee. At this draft head, the two serial 480 s calls leave at most about 24 nominal minutes of the 40-minute step for shard 1 execution and overhead if both approach their caps. For the first normal hosted subject, retain per-shard partition elapsed, shard-1 full-list elapsed, suite elapsed and JUnit counts, and artifact upload result under the same run/attempt/checkout. Keep the independent full denominator and fail-closed behavior. No extra run requested.

Copy link
Copy Markdown
Member Author

Follow-up e0942106962153de103acff6b89e1d18a7d30aff deletes only three orphan Python process-policy entries; the scanner does not scan tools/ci/*.py. The two Rust spawn entries remain; no scanner or workflow change. On the exact draft parent the native gate reproduced precisely those three orphan findings. The candidate policy data, with the same already-built native xtask, then passed check-process-policy and check-covered-by. The full native check-file-policy invocation hit the local 90s cap in its implicit broad test-binary preparation before producing a verdict. No rerun or hosted qualification; the PR remains draft.

Copy link
Copy Markdown
Member Author

Exact independent review found no material concern with the process-policy correction, and approved the final companion metadata delta now bound to c69205c714ff5b22c2615bc5f8802f44856a2c4c (TOML blob 18cd5485617b427772ce07f64ede5d4dc1f6995a). The two Python source paths keep exactly scoped non-Rust file registration, but no longer claim process-policy coverage: the existing process scanner does not traverse those Python paths. Both Rust launcher process rows stay unchanged. The exact local candidate’s check-process-policy, CLI exit contract, check-covered-by and diff checks passed; the previously exercised 26 controls, workflow lint and native repo-policy paths are unchanged by this metadata. The Linux-only integration selector is not registered as a cross-platform or Unix-family requirement. Standalone full file policy remains unqualified (local execution stopped during broader test-target enumeration, without a verdict); no hosted dispatch or merge action.

Copy link
Copy Markdown
Member Author

Full-policy qualification follow-up on exact head c69205c714ff5b22c2615bc5f8802f44856a2c4c, tree 1812b2d5403b2772ec5968e331021dfd53528e1d: one low-parallelism native attempt verified clean source before and after. The memory guard stopped it after 6m37s (exit 143 at ~1.42 GiB left) while compiling the RIPR library test and seven integration targets for test-valued covered_by enumeration. The preceding repo-policy warmup completed; the larger RIPR library test build did not. No full file-policy verdict, not a policy denial. Existing scoped preflight and independent review stand; no additional local retry, hosted dispatch or merge-preview qualification. Finish the unchanged full gate on a better-provisioned runner or with compatible warmed test binaries; do not weaken enumeration.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Evidence-only sweep triage: this PR currently conflicts with main (merge state CONFLICTING, stale since mid-November). An evidence-only head-exact review at the current head would be wasted work — the head must change to resolve the conflict, which invalidates any review posted now. Please rebase onto current origin/main and push; the evidence review lane will pick the refreshed head up from the sweep queue automatically. No defect is asserted — this is a landing-order state, not a code finding.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Native-Windows proof finding (review marker will note this — evidence gate red on this inherited tree): cargo xtask check-file-policy fails on this branch at head c69205c with:

policy/non-rust-allowlist.toml:1260 test-valued covered_byselects zero tests:cargo test -p xtask --example contabo_product_proof`` (same pattern also at line 1272)

Diagnosis (verified against source at this head): this is inherited main drift, not a defect introduced by this PR. The tree still carries the pre-#15116 contabo allowlist entries using plain covered_by = ["cargo test -p xtask --example contabo_product_proof"]; origin/main fixed this in 95dbb78 ("fix(ci): scope Contabo file-policy evidence to Linux (#15045) (#15116)") by scoping them to covered_by = [] + covered_by_linux = [...]. On this Windows host the example's tests do not enumerate under that selector (the example declares required-features = ["automation"] and its tests are Linux-scoped), so the test-valued pointer resolves to zero tests and the gate fails closed.

Action for the author: merge current origin/main (picks up the covered_by_linux scoping) and push; the next review/proof cycle at the new head can then include the file-policy gate for the two new #14906 allowlist entries this PR adds. The review marker for the current head scopes its native proof to the discovery tooling controls and process policy, and records this residual explicitly. No source change in this PR is implicated. (Identical findings filed on #14985 comment 7263909946, #15175 comment 7264025644, #13551, #14056, #15137, #15138, #15139.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant