Allow test runner thread overrides #2666
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2676"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:49:57Z.
scripts/test.ps1always added--test-threads=4. On Rust 1.99.0, libtest rejected a caller's second option before running tests; on Rust 1.100.0, duplicate options are accepted with the last value winning. The runner now gives callers a consistent override without passing duplicates.What is in it
RUST_TEST_THREADSforcargo testand restore the caller's environment afterward.--.Tested
--test-threads=Nand--test-threads Narguments with exit 101. Both explicit forms took precedence over the environment default.scripts/test-test-threads.tests.ps1andscripts/test-native-stderr.tests.ps1passed on PowerShell 5.1 and 7.6.9. The mock Cargo fixture checks argument forwarding, the four-thread default, and restoration for both an unset and a previously set environment variable.29e66d46passed with the patched runner on both shells for success, build failure, test failure, and missing Cargo.git diff --checkpassed.Regression run
Not tested
AI use
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-26T06:07:39Z.
The real runner works on Windows PowerShell 5.1, and the bug it fixes depends on the Rust version: Rust 1.98.1's libtest rejects a second
--test-threads, Rust 1.100.0's accepts it (the last one wins). So on 1.100.0main's runner already works with an explicit--test-threads; on 1.98.1 and older, this change is what makes it work.Windows 11 Pro 26300, Windows PowerShell 5.1.26100, RTX 3060,
mainb49be18:cargo +1.98.1 test -- --test-threads=4 --test-threads=2error: Option 'test-threads' given more than once+stable(1.100.0), and XCL's lib test binary with=and space forms in any ordertest result: ok.\scripts\test.ps1 vfs::tests --test-threads=2under PS 5.1 (real Cargo, Rust 1.100.0):main/ this PR merged ontomainscripts\test-test-threads.tests.ps1andscripts\test-native-stderr.tests.ps1under PS 5.1 on23c12a4test-threads: ok)Not tested: the whole workspace suite through the runner (only the
vfs::testsfilter), PowerShell 7.AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this comment.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:43:25Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:40:48Z.
Triage (#1607) – head
23c12a4No open or merged PR makes the same change. #1399 also touches the
--test-threads=4line ofscripts/test.ps1(a.env-driven$testThreads), but that is a different, larger change.The diff moves the default to
RUST_TEST_THREADS=4and restores the caller's value afterwards, so an explicit--test-threadsin the arguments no longer reaches libtest twice. Note that a caller's ownRUST_TEST_THREADSis still overridden by 4 (same as on main). No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:14:21Z.
merge-check
base:
1c8b551475head:
23c12a4200merge: clean (
git merge --no-editonto1c8b5514,git diff --checkclean;scripts/test.ps1+12/-5,scripts/test-test-threads.tests.ps1+47)build: not run (Tier 0 PowerShell script diff touching only
scripts/; no Rust code changed)tests: Windows PowerShell 5.1 (
5.1.26100.8457):scripts/test-test-threads.tests.ps1-> ok (test-threads: ok); other passing scripts (perf-compare.tests.ps1,perf-run.tests.ps1,smoke-title.tests.ps1,test-smoke-artifacts.tests.ps1) -> 4/4 ok.test-native-stderr.tests.ps1fails with exit 127 identically on clean base1c8b5514(pre-existing mockcargo.cmdmismatch withcargo benchinscripts/test.ps1). Rust workspace tests not run (Tier 0); PowerShell 7 not installed here.review: Read the full merged diff (
scripts/test.ps1:19-32,scripts/test-test-threads.tests.ps1). Moving the 4-thread default from a hardcoded--test-threads=4CLI flag toRUST_TEST_THREADS=4insidetry/finallyrestores the caller'sRUST_TEST_THREADSon exit while allowing explicit--test-threadsoverrides to pass through without duplicate-option errors on older Rust toolchains (e.g. 1.98.1). The fixture test covers=and space forms,--skip --test-threads=1,-- --test-threads=1, and env restoration for both set and unset caller values. Clean, minimal, no regressions.performance: none (script-only change in
scripts/; zero runtime impact)verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Windows PowerShell 5.1.26100.8457, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.