try to fix streaming responses

This commit is contained in:
Dobromir Popov
2026-07-07 22:19:22 +03:00
parent a0b37ad1b9
commit f0dc3bd93f
4 changed files with 140 additions and 26 deletions

View File

@@ -33,6 +33,21 @@ def test_dashboard_served_with_all_panels():
tracker.stop()
def test_dashboard_chat_uses_streaming_fetch():
tracker = TrackerServer(billing=BillingLedger())
port = tracker.start()
try:
html = urllib.request.urlopen(
f"http://127.0.0.1:{port}/dashboard"
).read().decode()
finally:
tracker.stop()
assert "stream: true" in html
assert ".body.getReader()" in html
assert 'data === "[DONE]"' in html
def test_dashboard_served_by_follower():
"""A tracker that is not the leader (unreachable peers → never elected)
still serves the dashboard from its own replicated state."""