mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1658] [CLOSED] tools tests: align test_setup_risk's WSL mock with install() (the KV-streaming rule test failed inside WSL) #3588
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3588
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1658
Author: @chaog992
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:risk-test-wsl📝 Commits (1)
4a9c115tools tests: align test_setup_risk's WSL mock with install() (the KV-streaming rule test failed inside WSL)📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
tools/test_setup_risk.py(+1 -0)📄 Description
Title
Issue: none opened. The same kind of failure as #974 (fixed test-only in
d1ec32b), here intools/test_setup_risk.py.Summary
Inside WSL, one test in
tools/test_setup_risk.pyfails on main (fb58e0d):RulesAgreeWithTheWrittenConfig.test_the_streaming_rule_is_the_flag_setup_writes. The test askedkv_streaming_wanted()on a different PC from the onesetup.main()ran on. This change runs the whole test onthe same mocked PC. It changes only the test, by one line.
What changed
tools/test_setup_risk.py(+1):@mock.patch.object(setup, "is_wsl", lambda: False), the mockinstall()alreadyapplies. So
kv_streaming_wanted()is asked on the same PC assetup.main().d1ec32bfixed the unsloth tests for #974 with the same mock.Why it failed:
setup.main()runs insideinstall(), which mocksis_wsl()to False(
tools/test_setup_golden.pyline 106). The test then calledsetup.kv_streaming_wanted()outside that mock.Inside WSL the real
is_wsl()returns True, so the rule said "no streaming" while the config that setup wrote for themocked PC has
--kv-resident 32768. The test failed at its first 131072 case (setup's args shortened):In this test's 54 cases, setup's decision is not at fault. When
is_wsl()is the same on both sides, setup and therule agree in all of them:
fb58e0d.--kv-residentin none of them.Left alone:
setup.py, so what setup writes is unchanged.low_ram_wanteddoes not readis_wsl.This is independent of #1498, which changes only
src/core/layer.cpp.Extra Notes
Checked on WSL2 (Ubuntu 24.04.1, kernel 5.15.167.4) with Python 3.12.3. Base
fb58e0d, head4a9c115.python3 tools/test_setup_risk.py: FAILED (failures=1) on the base, Ran 40 tests, OK on the head.python3 -m unittest tools.test_setup_riskalso passes on the head.After the test, whether it passes or fails,
setup.is_wslis the original function again.The test still catches the two copies of the rule disagreeing:
kv_streaming_wanted(), it fails (True != False);setup.main()'sstream_fits, it fails (False != True).With
is_wslforced to False around the test, as on Windows or native Linux, it passes on the base and thehead, so nothing changes off WSL.
With
is_wslforced to True, it fails on the base and passes on the head. To reproduce off WSL, run this fromthe checkout root:
The other 27
tools/test_setup_*.pyfiles give the same results on the base and the head. Two of them fail onthis machine for other reasons, on both, and this PR does not touch them:
test_setup_engine_hash(#1510) andtest_setup_unsloth'stest_amd_is_not_asked.Not run: Windows and native Linux (only simulated with the
is_wslpatch above), and other Python versions.In the repo's Python files, no test patches
is_wslto anything but False, and none touchesplatform.uname.So setup's WSL branches have no test of their own. Adding one would be a separate change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.