mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3320] [CLOSED] [Benchmark] bind the port so strata_bench.py can start its own server #4566
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#4566
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/3320
Author: @victorgabr
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:fix/bench-port-nameerror📝 Commits (1)
8c1d078[Benchmark] bind the port so strata_bench.py can start its own server (#3188)📊 Changes
2 files changed (+23 additions, -1 deletions)
View changed files
📝
tools/strata_bench.py(+2 -1)📝
tools/test_strata_bench.py(+21 -0)📄 Description
Closes #3188. Also covers the crash reported in #2864, #2872, #2908 and #3130.
Problem and resulting behavior
tools/strata_bench.pydies withNameError: name 'port' is not definedon every run that has to start the server itself - the default path, and the oneBENCH.batand the setup "Run a quick benchmark now?" prompt use:After this change the tool starts the server on the config's port (or
--port), waits for the model, runs the suite and writes the results folder; the "port is used by something that is not Strata" message also prints the real port instead of crashing.Why this approach
Commit
69fe4055(#2330) replacedport = a.port or int(cfg.get("port", 8080))+base = f"http://127.0.0.1:{port}"withbase = server_base(cfg.get("host"), a.port or int(cfg.get("port", 8080)))and left the three remaining uses ofport(lines 987, 990, 991) unbound. The fix restores the assignment the line used to carry and uses it in all three places - the same shape suggested in #3188. The--urlpath is untouched.The suite never caught it because every
main()test passes--url, so the start-server branch is never executed; that gap is called out in #3188. One new test (test_the_start_server_branch_knows_its_port) reaches the branch with a stubbedstart_server: it asserts the config's port reaches the starter and the not-ready path returns 1, and that a non-Strata port occupant returns 2 with the port named in the message.Validation
On
upstream/maine88ee39d, Linux, Python 3.14.7, branch exactly as submitted:Passed
python tools/test_strata_bench.pywith the fix:Ran 18 tests ... OK(17 existing + the new one).FAILED (errors=1), with the real tracebackNameError: name 'port' is not defined,line 990, in main.python tools/strata_bench.py --config strata-iq3_s.jsonon Linux (TITAN RTX, engine 0.1.45.3) started its own server, ran the suite and wrote a full results folder - the path the change unblocks. Two paired runs this way produced the A/B evidence posted alongside this bug report's thread dates.Failed
Not run
BENCH.bat) - the changed code is platform-independent Python and reproduces identically on Windows per #3188 and #3130, but I ran it only on Linux.Limits
The new test stubs
start_server, so it proves the branch binds and passes the port, not that a real engine boots. The port-free check still relies on/healthprobing (unchanged behavior).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.