[PR #2919] [CLOSED] fix(bench): set port again when the bench starts the server #4337

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2919
Author: @ByteJuggler
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: pr/bench-port


📝 Commits (1)

  • 136c3ec fix(bench): set port again when the bench starts the server; #2330 dropped it, so BENCH stopped with NameError

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

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

📄 Description

`tools/strata_bench.py` stops with `NameError: name 'port' is not defined` whenever it has to start the server itself, which is the default for `BENCH.bat` / `bench.sh` when no server is running yet:

```
File "tools/strata_bench.py", line 1007, in main
if port_answers(port):
NameError: name 'port' is not defined
```

#2330 changed the address line to `base = server_base(cfg.get("host"), a.port or int(cfg.get("port", 8080)))` and dropped the `port = ...` line before it. `port` is still used afterwards: in the port-in-use check, the messages and `start_server(cfg_path, port, ...)`.

The fix sets `port` again and passes it to `server_base`. One line; no change when a server is already running or `--url` is given.

Tested: `python tools/test_strata_bench.py` passes (17 tests), and `strata_bench.py --config ...` with no server running now starts the server and completes the suite (Windows, HIP, six models).


🔄 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/2919 **Author:** [@ByteJuggler](https://github.com/ByteJuggler) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/bench-port` --- ### 📝 Commits (1) - [`136c3ec`](https://github.com/Niko1221/Strata/commit/136c3ec57491d244a60fba4fd034930341ecb07b) fix(bench): set port again when the bench starts the server; #2330 dropped it, so BENCH stopped with NameError ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/strata_bench.py` (+2 -1) </details> ### 📄 Description \`tools/strata_bench.py\` stops with \`NameError: name 'port' is not defined\` whenever it has to start the server itself, which is the default for \`BENCH.bat\` / \`bench.sh\` when no server is running yet: \`\`\` File "tools/strata_bench.py", line 1007, in main if port_answers(port): NameError: name 'port' is not defined \`\`\` #2330 changed the address line to \`base = server_base(cfg.get("host"), a.port or int(cfg.get("port", 8080)))\` and dropped the \`port = ...\` line before it. \`port\` is still used afterwards: in the port-in-use check, the messages and \`start_server(cfg_path, port, ...)\`. The fix sets \`port\` again and passes it to \`server_base\`. One line; no change when a server is already running or \`--url\` is given. Tested: \`python tools/test_strata_bench.py\` passes (17 tests), and \`strata_bench.py --config ...\` with no server running now starts the server and completes the suite (Windows, HIP, six models). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:59 +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#4337
No description provided.