Pull requests / #2558
#2558 tests: the MCP server's tests do not see a Strata server this PC already runs on 8080
closed · @qiuzan2001 · 0 コメント · GitHub で見る
Setup & installServer & APIModels & quants
本文
Same family as #1935 (tests that pass or fail depending on the PC), not in its list. **What it changes.** `tools/strata_mcp.py`'s tools look at the default port (8080) and at every config's port. The fake Strata folder in `tools/test_strata_mcp.py` wrote its configs with port 8080 (the fake `setup.py` and `write_config()`), and the default port was the real one. On a PC that runs Strata on 8080 (the normal install), the `StartStop` tests found that server in the fake folder's status: `test_start_status_bench_stop`, `test_loading_then_ready`, `test_status_sees_other_programs_on_the_port` failed and `test_never_kills_an_unrelated_process` errored (`'loading' not found in 'Strata is running on port 8080: swift-1.5-iq3_s, idle; installed: q2_0'`), and `test_plan_then_install` sent `/health`, `/status`, `/metrics` and `/v1/status` to the real server. Each test now gets a free port of its own in `FakeRoot.setUp`: `M.DEFAULT_PORT` is patched to it, the fake `setup.py` writes it into the configs it makes, and `write_config()` uses it unless a test names a port. `test_plan_then_install` also checks that nothing is reported running. **What it leaves alone.** `tools/strata_mcp.py`, and what every test checks. Tests that already chose a port with `free_port()` keep it. **How it was checked.** On this PC (Ubuntu, Python 3.14) with Strata 0.1.44.1 serving on 127.0.0.1:8080: `python3 tools/test_strata_mcp.py` gives 3 failures and 1 error on `upstream/main`, and 24 OK with this change in 13 of 14 runs (one run had 1 error I could not reproduce in 13 more runs; I did not find which test). With a wrapper that counts socket connections to port 8080, the suite makes none (it made one with only the default-port part of this change). Not run on a PC with nothing on 8080. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
関連リンク
インストール・モデル・リリースへの站内リンク。