Skip to content

Fix visualizer server startup failures - #1225

Merged
rickwierenga merged 2 commits into
PyLabRobot:mainfrom
Aming9303:fix/1224-visualizer-startup
Aug 28, 2026
Merged

Fix visualizer server startup failures#1225
rickwierenga merged 2 commits into
PyLabRobot:mainfrom
Aming9303:fix/1224-visualizer-startup

Conversation

@Aming9303

Copy link
Copy Markdown
Contributor

What changed

  • retry server startup only for EADDRINUSE, with a 100-port limit
  • propagate other WebSocket and HTTP startup exceptions to setup()
  • replace blocking lock polling with timeout-aware awaitable futures
  • stop the WebSocket server even before a browser connects and clean up test servers reliably
  • support port 0 so tests can request OS-assigned ports
  • remove the no-longer-needed pytest-timeout dependency

Tests

  • python -m pytest pylabrobot/visualizer/visualizer_tests.py -q (26 passed)
  • python -m ruff check pylabrobot/visualizer/visualizer.py pylabrobot/visualizer/visualizer_tests.py
  • python -m ruff format --check pylabrobot/visualizer/visualizer.py pylabrobot/visualizer/visualizer_tests.py
  • python -m mypy pylabrobot/visualizer/visualizer.py

Resolves #1224

@rickwierenga

Copy link
Copy Markdown
Member

thanks for the pr!

please green the ci

@Aming9303

Copy link
Copy Markdown
Contributor Author

Fixed the Python 3.9 mypy failure by treating server.sockets as an iterable rather than indexing it. The focused type check now passes, along with all 26 visualizer tests, Ruff, and format checks.

@rickwierenga
rickwierenga merged commit 3f9448a into PyLabRobot:main Aug 28, 2026
21 checks passed
@rickwierenga

Copy link
Copy Markdown
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visualizer setup can hang indefinitely when server socket creation fails

2 participants