diff --git a/test/test_esp32_usb_serial_hygiene.py b/test/test_esp32_usb_serial_hygiene.py index b510f6e4a..59ec1eb79 100644 --- a/test/test_esp32_usb_serial_hygiene.py +++ b/test/test_esp32_usb_serial_hygiene.py @@ -164,12 +164,16 @@ int main() { self.assertNotIn("command_radio_reply_route", body) self.assertNotIn("saved_radio_apply_pending", body) delayed = source("src/helpers/CompanionDelayedReplies.cpp") - lease = delayed[delayed.index("bool CompanionDelayedReplies::hasReplyForRoute("):] + lease = extract_braced(delayed, "bool CompanionDelayedReplies::hasReplyForRoute(") self.assertIn("{ &request, &trace }", lease) self.assertIn("reply->route == route", lease) self.assertIn("reply->phase >= AwaitRadio", lease) - self.assertIn("reply->delivery_deadline : reply->radio_deadline", lease) - self.assertIn("reply->sent_deadline", lease) + self.assertIn("!expired(*reply, now)", lease) + # Lease queries and delivery share the same bounded expiry policy. + expiry = extract_braced(delayed, "bool CompanionDelayedReplies::expired(") + self.assertIn("reply.phase == AwaitAdmission", expiry) + self.assertIn("reply.delivery_deadline : reply.radio_deadline", expiry) + self.assertIn("reply.sent_pending && due(now, reply.sent_deadline)", expiry) self.assertIn("expected_ack_table[i].reply_route == route", body) self.assertNotIn("_iter_started", body) self.assertNotIn("lockReplyRoute", body)