test(perception): exercise lifecycle and lease loss in full profile
This commit is contained in:
@@ -51,6 +51,29 @@ def test_active_bytes_count_towards_memory_limit(pilot):
|
||||
assert queue.take() is None
|
||||
|
||||
|
||||
def test_interrupted_decode_accounts_for_released_but_not_admitted_camera(pilot, monkeypatch):
|
||||
module = pilot("run_joint_pilot")
|
||||
event = SimpleNamespace(time_ns=1_000_000_000, channel="camera", sequence=0, value={})
|
||||
archive = SimpleNamespace(counters=lambda: {}, close=lambda: None)
|
||||
monkeypatch.setattr(module, "SensorArchive", lambda _path: archive)
|
||||
monkeypatch.setattr(module, "camera_events", lambda *args: iter([event]))
|
||||
monkeypatch.setattr(module, "merged_events", lambda *args: iter([event]))
|
||||
|
||||
def interrupted(*args):
|
||||
raise EOFError("decoder stopped by supervisor")
|
||||
|
||||
monkeypatch.setattr(module, "send", interrupted)
|
||||
queue = pilot("pilot_queue").Mailbox()
|
||||
report = {}
|
||||
stop = SimpleNamespace(is_set=lambda: False, wait=lambda _seconds: False)
|
||||
args = SimpleNamespace(sensor_archive="unused", camera_index="unused", frames=1)
|
||||
module.produce(args, SimpleNamespace(stdin=None), queue, stop, report)
|
||||
assert report["arrivals"]["camera"] == 1
|
||||
assert report["failed_camera_sequences"] == [0]
|
||||
assert "decoder stopped" in queue.error and queue.dropped_count == 0
|
||||
assert queue.quiescent
|
||||
|
||||
|
||||
def test_numpy_member_is_read_incrementally_and_bounded(pilot):
|
||||
data = io.BytesIO()
|
||||
np.savez_compressed(data, points=np.arange(300, dtype="<f8").reshape(100, 3))
|
||||
|
||||
Reference in New Issue
Block a user