Files
LEDMatrix/test/test_root_display_controller_shim.py
T
ChuckandClaude Opus 5.5 6f45ff5e63 fix(display): thread-safety for deferred updates, BDF faces and follower image; one refresh default (#652)
- DisplayManager.defer_update()/process_deferred_updates(): one lock around
  every queue mutation (appends from the update thread were lost to the
  render thread's filter/slice reassignments); callables run outside it.
- FontManager and element_style no longer cache BDF freetype.Face objects
  process-wide (load_bdf_face caches them per thread); element_style's LRU
  is locked against get/move_to_end vs eviction races.
- limit_refresh_rate_hz default is one constant, DEFAULT_REFRESH_LIMIT_HZ =
  100 (the template's), for the library options, refresh_hz, the matrix
  guard, Vegas and scroll_config. Previously a missing key capped the panel
  at 90 while pacing assumed 100.
- Sync follower: the TCP thread queues the leader's scroll image; the render
  thread swaps image/array/width in between frames.
- update_display() error log rate-limited (traceback first, then once a
  minute with a count); swallowed DisplayController exceptions log at DEBUG.
- Root display_controller.py runs run.py via runpy.
- stream_manager: correct the RLock release comments; merge duplicate if.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 10:39:40 -04:00

22 lines
737 B
Python

"""The repo-root display_controller.py goes through run.py.
It used to call src.display_controller.main() directly, skipping run.py's
sys.dont_write_bytecode, its -e/-d flags and its logging setup. run.py's
argument parser answering --help shows the shim now runs run.py.
"""
import subprocess
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def test_root_display_controller_runs_run_py():
result = subprocess.run(
[sys.executable, str(REPO_ROOT / "display_controller.py"), "--help"],
cwd=str(REPO_ROOT), capture_output=True, text=True, timeout=60,
)
assert result.returncode == 0, result.stderr
assert "--emulator" in result.stdout and "--debug" in result.stdout