Skip to content

Commit 992bd3b

Browse files
committed
fix: avoid private telemetry thread state
1 parent 11770ae commit 992bd3b

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

juturna/components/_telemetry_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def start(self):
2929
self._thread.start()
3030

3131
def stop(self):
32-
if self._thread is None or self._thread._is_stopped:
32+
if self._thread is None or not self._thread.is_alive():
3333
return
3434

3535
self._queue.put(ControlSignal.STOP)

tests/test_telemetry_manager.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from juturna.components._telemetry_manager import TelemetryManager
2+
3+
4+
class StoppedThread:
5+
def is_alive(self):
6+
return False
7+
8+
9+
def test_telemetry_stop_uses_public_thread_api(tmp_path):
10+
manager = TelemetryManager(str(tmp_path / 'telemetry.csv'))
11+
manager._thread = StoppedThread()
12+
13+
manager.stop()

0 commit comments

Comments
 (0)