Skip to content

ci: size test threads to the machine and run platform tests through one nextest profile - #523

Merged
lg2m merged 5 commits into
mainfrom
ci/test-structure
Nov 1, 2026
Merged

lg2m merged 5 commits into
mainfrom
ci/test-structure

Conversation

@lg2m

@lg2m lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #521, which has since merged into main, so this PR targets main.

Change

CI and the local gate (B1–B7 in the test audit):

  • B1. Threads. test-threads = "num-cpus". A new real-process test group (max 2 threads) holds the tests that spawn, kill and reap real process trees: process_group, windows_job, the shell kill, timeout and yield tests, the orphan, child-exit and zombie tests, goal-check process teardown, and the daemon binaries. The priority override covers 15 named tests that run over 2.5 s on CI, down from 382 whole-module tests. The Linux CI runner keeps NEXTEST_TEST_THREADS=8, measured below.
  • B2. Devcontainer. The devcontainer job runs on a pull request only when .devcontainer/, Dockerfile*, rust-toolchain.toml or Cargo.lock changed, which a git diff job decides, or when the PR has ci:full. It still runs on every merge-queue, main, nightly (new schedule) and manual run.
  • B3. Platform tests. The 28 hand-picked test-exact.sh steps are replaced by a nextest platform profile with one default filter per OS. That brings nextest timeouts, retries and JUnit. windows-teardown and native-run-in-place merge into one platform matrix (Windows and macOS). Each job diffs cargo nextest list --profile platform against .config/platform-tests/<os>.txt and fails on any difference. A new platform-tests rule in cargo xtask lint fails when a #[cfg(windows)] or #[cfg(target_os = "macos")] test is missing from its list. This replaces test-exact.sh and test-exact-test.sh. The Git 2.39 job, the smoke --only steps, the macOS coreutils setup and the embed example stay.
  • B4. Smoke build. cargo xtask smoke --reuse-test-build builds qq as --workspace --bin qq --tests, the same feature set as the workspace test build, so it reuses that build instead of relinking with fewer features. CI uses it after the full gate and in the platform jobs. PR runs keep the plain build, because an affected-only test build doesn't share a feature set with either.
  • B5. Core profiles. "Minimal core profile" and "Public core embedding lifecycle" move into their own core-profiles job, which runs in parallel with checks.
  • B6. Soak group. A soak test group holds goal_driver_soak::multi_day_* and binary_id(qq-core::soak). cargo xtask check passes -E 'not group(soak)'. --full, which runs in the merge queue, on main, nightly and manually, includes the group, so a local --full runs what CI runs.
  • B7. Quarantine. .config/quarantine.toml starts empty and holds {test, owner, issue, added, expires} entries.
    • cargo xtask lint fails on a missing owner, issue or date, a name that matches no listed test, an expires more than 14 days after added, or an entry that has expired.
    • cargo xtask check excludes the listed tests from its test gates.
    • cargo xtask quarantine prints the filterset.
    • A non-blocking quarantine job stress-runs the listed tests 100 times.
    • The hand-rolled parser avoids a new dependency and has unit tests.
  • Docs. docs/runbooks/testing.md gets the CI job table, the nextest groups, the flake policy and the quarantine procedure. docs/runbooks/windows-ci.md now describes the platform job.

Required checks for the merge queue: fmt, lint, clippy, tests, smoke, minimal core profile and embedding, qq-client on wasm32, platform tests (windows-latest), platform tests (macos-latest), undo on Git 2.39 (debian:bookworm).

Verification

  • Full workspace, --profile ci, warm, 32 cores, two runs each:

    Run Time Tests
    Before 23.2 s 3033
    After 13.4 s 3033
    After, PR gate without soak 13.0 s 3010

    The brief's 64 s baseline predates fix(core): remove the known test flakes and give command-tree teardown a 10 s confirmation budget #520 and test(core): drive session wall time and deadlines from one clock #521.

  • 4 vCPUs simulated with taskset -c 0-3:

    Config Time
    Old config (8 threads) 33.7 s
    New config, NEXTEST_TEST_THREADS=8, PR gate 31.1 s
    New config, NEXTEST_TEST_THREADS=8, full 34.3 s
    Plain num-cpus (4 threads) 45–47 s

    Many tests wait on real time, processes or fsync, so oversubscription helps on small runners. That is why CI pins 8.

  • real-process max-threads: 2 → 13.5 s, 3 → 11.8 s, 4 → 10.2–11.6 s on 32 cores. I kept 2 for teardown headroom on loaded runners.

  • B3 selection, per OS, computed from the old ci.yml steps against the new lists:

    • Windows keeps all 24 old tests and adds 3 Windows-only tests that never ran before: windows_dpapi_round_trip_replaces_and_removes_oversized_secret, quoted_redirection_reaches_cmd_unchanged and ab1_cmd_separators_and_native_sort_output_are_work.
    • macOS keeps all 14 and adds none.
    • With the macOS filter pointed at Linux, bash .github/scripts/platform-tests.sh macos selected exactly the 14 listed tests and ran them green. A renamed test in the filter made it fail with a diff.
  • Removing 4 entries from windows.txt made cargo xtask lint report each missing test with its file:line.

  • A quarantine file with an expired entry, an ownerless entry and an unknown test made the lint report each one. cargo xtask check --dry-run showed the exclusion filter.

  • B4: the CI log shows about 29 s between the end of the full gate and the start of smoke scenarios on main (run 41265348978). Locally, after a workspace test build, --reuse-test-build relinks nothing, while the plain build recompiled qq-core through qq.

  • actionlint on ci.yml: clean.

  • cargo xtask check --full: passed on 6c30fda, test gate 18.0 s with soak. cargo xtask check: passed, 3010/3010, 13.3 s.

Known impact

  • goal_enabled_soak_measures_real_notices_across_compaction (qq-core::soak) is flaky under load before and after this change. On one loaded core it failed 4/40 on the old config and 2/30 on the new one (work_requests_with_goal 0 vs 72), and once in a full run on 4 cores. It is in the soak group, so it no longer blocks PRs. It still runs in the merge queue. I did not quarantine it, because no issue exists yet and the fix is out of scope.
  • The Windows and macOS jobs are untested until this PR's ci:full run. I can't run Windows locally.
  • No tests deleted.

…ne nextest profile

Tests use one thread per CPU; real-process tests share a two-thread group so
their exit confirmation is not starved, and only the ~15 slowest tests get
priority. Soak tests form a group the pull-request gate leaves out and
`cargo xtask check --full` runs.

The hand-picked test-exact steps become a nextest `platform` profile whose
selection CI diffs against .config/platform-tests/<os>.txt; the two Windows
jobs merge into one. `cargo xtask lint` requires every Windows- or
macOS-only test to be listed.

Adds a 14-day quarantine list with a lint, a gate exclusion and a
non-blocking stress job, starting empty. The devcontainer job runs only when
its inputs change or off pull requests; the minimal core profile runs as its
own job.
@lg2m lg2m added the ci:full label Nov 1, 2026
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T13:00:27.705670Z fa4efff Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7c2b8b1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/smoke.rs Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread docs/runbooks/testing.md Resolved
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f98959ebc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/lint.rs Resolved
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3f9ceec10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Resolved
Comment thread xtask/src/quarantine.rs Resolved
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: fa4efff5a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lg2m
lg2m added this pull request to stack #526 November 1, 2026 20:03
@lg2m
lg2m merged commit 10c8e50 into main Nov 1, 2026
14 checks passed
@lg2m
lg2m deleted the ci/test-structure branch November 1, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant