fix(simulation): cache idle worker state
This commit is contained in:
@@ -171,6 +171,28 @@ def test_worker_agent_command_dispatch_fails_closed_on_unsafe_envelope() -> None
|
||||
)
|
||||
|
||||
|
||||
def test_worker_agent_caches_the_absence_of_an_active_run() -> None:
|
||||
class EmptyStore:
|
||||
def __init__(self) -> None:
|
||||
self.list_calls = 0
|
||||
|
||||
def list_runs(self) -> tuple[QualificationRun, ...]:
|
||||
self.list_calls += 1
|
||||
return ()
|
||||
|
||||
agent = object.__new__(SimulationWorkerAgent)
|
||||
store = EmptyStore()
|
||||
agent.__dict__["store"] = store
|
||||
|
||||
first = agent.status()
|
||||
second = agent.status()
|
||||
|
||||
assert first["available"] is True
|
||||
assert first["active_run_id"] is None
|
||||
assert second["active_run_id"] is None
|
||||
assert store.list_calls == 1
|
||||
|
||||
|
||||
def test_px4_adapter_maps_speed_to_stock_rover_throttle_without_direct_actuators() -> None:
|
||||
publishers = [_Publisher() for _ in range(3)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user