[PR #2558] [CLOSED] tests: the MCP server's tests do not see a Strata server this PC already runs on 8080 #4123

Closed
opened 2026-11-07 15:33:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2558
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: chief-serve/mcp-tests-port


📝 Commits (1)

  • c2b1df7 tests: the MCP server's tests do not see a Strata server this PC already runs on 8080

📊 Changes

1 file changed (+12 additions, -3 deletions)

View changed files

📝 tools/test_strata_mcp.py (+12 -3)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2558 **Author:** [@qiuzan2001](https://github.com/qiuzan2001) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chief-serve/mcp-tests-port` --- ### 📝 Commits (1) - [`c2b1df7`](https://github.com/Niko1221/Strata/commit/c2b1df76d1feff47c2fa6f2779eeef74d76b14b3) tests: the MCP server's tests do not see a Strata server this PC already runs on 8080 ### 📊 Changes **1 file changed** (+12 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tools/test_strata_mcp.py` (+12 -3) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:33:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4123
No description provided.