What I observed
mega-tron qa-live (on 1b6aaba) always spawns a fresh mega-tron dashboard --port 7531 after at least one host PASSes. It does not check whether a dashboard is already running, or whether anything is bound to port 7531. On boxes where the user manages their own dashboard process (e.g. fronted by a reverse proxy on a non-loopback bind), every qa-live run leaves a redundant 127.0.0.1:7531 listener behind that has to be killed by hand.
Repro
- Launch a dashboard on a non-loopback bind:
mega-tron dashboard --host 172.18.0.1 --port 7531 --no-open &
- Run
mega-tron qa-live.
- After PASS, observe a second mega-tron process bound to 127.0.0.1:7531 (output line:
[check] dashboard launched in background (PID … ) at http://127.0.0.1:7531/).
ss -tlnp | grep 7531 shows two listeners.
Expected
qa-live skips the dashboard spawn if a mega-tron dashboard process is already running (or if port 7531 is already bound on any local interface).
Code
The spawn is unconditional at src/mega_tron/cli/qa_live.py:634:
pid = _launch_dashboard_detached()
_launch_dashboard_detached (line 451) does a straight subprocess.Popen([…, "dashboard", "--no-open", "--port", "7531"]) with no pre-checks.
Suggested fix
Before line 634, skip the spawn (and print a "using existing dashboard at …" message) when either:
- any process named
mega-tron dashboard is alive, or
- port 7531 is already bound on
127.0.0.1, 0.0.0.0, or any interface mega-tron discovers.
Either check is a few lines
What I observed
mega-tron qa-live(on 1b6aaba) always spawns a freshmega-tron dashboard --port 7531after at least one host PASSes. It does not check whether a dashboard is already running, or whether anything is bound to port 7531. On boxes where the user manages their own dashboard process (e.g. fronted by a reverse proxy on a non-loopback bind), every qa-live run leaves a redundant 127.0.0.1:7531 listener behind that has to be killed by hand.Repro
mega-tron dashboard --host 172.18.0.1 --port 7531 --no-open &mega-tron qa-live.[check] dashboard launched in background (PID … ) at http://127.0.0.1:7531/).ss -tlnp | grep 7531shows two listeners.Expected
qa-live skips the dashboard spawn if a
mega-tron dashboardprocess is already running (or if port 7531 is already bound on any local interface).Code
The spawn is unconditional at
src/mega_tron/cli/qa_live.py:634:_launch_dashboard_detached(line 451) does a straightsubprocess.Popen([…, "dashboard", "--no-open", "--port", "7531"])with no pre-checks.Suggested fix
Before line 634, skip the spawn (and print a "using existing dashboard at …" message) when either:
mega-tron dashboardis alive, or127.0.0.1,0.0.0.0, or any interface mega-tron discovers.Either check is a few lines