Skip to content

Commit 0668e88

Browse files
authored
Only send last message if test still running (#939)
Fix the "Unknown test UID" message that appears in the web gui after any test has completed. This is caused by the last test record containing information about a test that has completed. Tests that complete are no longer in the TEST_INSTANCES list, so the web gui can't retrieve any more information about it.
1 parent 95f15c4 commit 0668e88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

openhtf/output/servers/station_server.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,13 @@ def _publish_test_state(cls, test_state_dict, message_type):
280280
cls._last_message = message
281281

282282
def on_subscribe(self, info):
283-
"""Send the more recent test state to new subscribers when they connect."""
284-
if self._last_message is not None:
283+
"""
284+
Send the more recent test state to new subscribers when they connect,
285+
unless the test has already completed.
286+
"""
287+
test, _ = _get_executing_test()
288+
289+
if self._last_message is not None and test is not None:
285290
self.send(self._last_message)
286291

287292

0 commit comments

Comments
 (0)