[PR #3098] [CLOSED] [Benchmark] fix: strata_bench defines the port it prints (#3096) #4451

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3098
Author: @ctr-137
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/bench-port-3096


📝 Commits (1)

  • 4d5e393 fix: strata_bench defines the port it prints (main used port in the message for a taken port and in the message naming the server it starts, but only had the value inline for the address, so both paths crashed with a NameError - #3096)

📊 Changes

2 files changed (+27 additions, -1 deletions)

View changed files

📝 tools/strata_bench.py (+2 -1)
📝 tools/test_strata_bench.py (+25 -0)

📄 Description

What it changes

main used port in two messages but only had the value inline for the address, so both paths crashed with a NameError. It now defines port once (--port, else the config's port, else 8080) and uses it for the address and for both messages — only on the path that starts its own server; with --url the config's port is not read at all.

Three regression tests: one per path that read port (the message for a port taken by something else, and the message naming the server the bench starts itself), and one for --url with a config whose port is null.

What it leaves alone

No behaviour change. The address, the server start, the exit codes and the report are as they were; the value port now holds is the same one that was already used to build base.

Validation

Environment: Windows 11, Python 3.14.7; branch based on main @ 477ac13c.

  • The two original tests fail on unpatched main with the NameError from #3096 at tools/strata_bench.py:990.
  • The --url test fails on this branch's first commit with TypeError: int() argument must be ... not 'NoneType' (on main it passes: with --url the config's port is never read there).
  • python tools/test_strata_bench.py: 20 tests, OK. CPU only, no GPU, no model files, Windows, Python 3.14.7.
  • The existing test_no_server_is_an_error_not_a_crash covers only the --url path without a config, which is why this survived.
  • Not tested on the reporter's machine (Strix Halo APU, Python 3.15).

Fixes #3096


🔄 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/3098 **Author:** [@ctr-137](https://github.com/ctr-137) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/bench-port-3096` --- ### 📝 Commits (1) - [`4d5e393`](https://github.com/Niko1221/Strata/commit/4d5e393705f9a11239bfd06363214f74bb09df0d) fix: strata_bench defines the port it prints (main used `port` in the message for a taken port and in the message naming the server it starts, but only had the value inline for the address, so both paths crashed with a NameError - #3096) ### 📊 Changes **2 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/strata_bench.py` (+2 -1) 📝 `tools/test_strata_bench.py` (+25 -0) </details> ### 📄 Description ## What it changes `main` used `port` in two messages but only had the value inline for the address, so both paths crashed with a `NameError`. It now defines `port` once (`--port`, else the config's port, else 8080) and uses it for the address and for both messages — only on the path that starts its own server; with `--url` the config's port is not read at all. Three regression tests: one per path that read `port` (the message for a port taken by something else, and the message naming the server the bench starts itself), and one for `--url` with a config whose port is `null`. ## What it leaves alone No behaviour change. The address, the server start, the exit codes and the report are as they were; the value `port` now holds is the same one that was already used to build `base`. ## Validation Environment: Windows 11, Python 3.14.7; branch based on `main` @ `477ac13c`. - The two original tests fail on unpatched `main` with the `NameError` from #3096 at `tools/strata_bench.py:990`. - The `--url` test fails on this branch's first commit with `TypeError: int() argument must be ... not 'NoneType'` (on `main` it passes: with `--url` the config's port is never read there). - `python tools/test_strata_bench.py`: 20 tests, OK. CPU only, no GPU, no model files, Windows, Python 3.14.7. - The existing `test_no_server_is_an_error_not_a_crash` covers only the `--url` path without a config, which is why this survived. - Not tested on the reporter's machine (Strix Halo APU, Python 3.15). Fixes #3096 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:36:03 +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#4451
No description provided.