diff --git a/openhtf/output/servers/station_server.py b/openhtf/output/servers/station_server.py index fe20bb2bb..ba47f7cdb 100644 --- a/openhtf/output/servers/station_server.py +++ b/openhtf/output/servers/station_server.py @@ -280,8 +280,13 @@ def _publish_test_state(cls, test_state_dict, message_type): cls._last_message = message def on_subscribe(self, info): - """Send the more recent test state to new subscribers when they connect.""" - if self._last_message is not None: + """ + Send the more recent test state to new subscribers when they connect, + unless the test has already completed. + """ + test, _ = _get_executing_test() + + if self._last_message is not None and test is not None: self.send(self._last_message)