Preserve AOL intent during temporary EPS event joins

This commit is contained in:
firestar5683
2026-10-25 12:25:17 -05:00
parent e404020aca
commit d33f5b550c
3 changed files with 32 additions and 2 deletions
@@ -314,3 +314,32 @@ def test_initial_eps_off_cannot_reorder_the_preceding_accepted_active_source():
assert 11_530_000_000 - proof.aolAxisState.sourceCarStateMonoTime < 30_000_000
assert not receive(11_530_000_000, axis=proof.as_reader(), state=temporary)
assert not card.aol_card_intent.allowed_latch
def test_axis_first_eps_join_uses_last_accepted_active_proof_without_renewing_leases():
case = fixture.IoniqAvailabilityTests(methodName='runTest')
with OpenpilotPrefix(), ExitStack() as cleanup:
cleanup.callback(case.doCleanups)
sd, _, drive, card, receive = baseline(case)
feedback = card.aol_transport_feedback
original = leases(feedback)
drive(152, gas=True, native_request_long=False)
temporary = fixture.car_state()
temporary.gasPressed = temporary.steerFaultTemporary = True
assert receive(11_529_500_000, axis=sd.pm.messages['aolAxisState'],
event=sd.pm.messages['onroadEvents'], state=temporary)
active = feedback.signature
assert leases(feedback) == original
withdrawn, _, command = drive(153, gas=True, observed_state=temporary,
native_request_lat=True, native_request_long=False)
assert not withdrawn.lateralActive and not withdrawn.longitudinalActive
assert not command.latActive and not command.longActive
proof, event = sd.pm.messages['aolAxisState'], sd.pm.messages['onroadEvents']
now = 11_541_000_000
assert now - original[1] > 30_000_000
assert now - active[8] <= 30_000_000 and now <= active[4]
assert receive(now, axis=proof, state=temporary)
assert card.aol_card_intent.allowed_latch and not feedback.failed
assert leases(feedback) == original
assert receive(now + 100_000, event=event, state=temporary)
assert card.aol_card_intent.allowed_latch and leases(feedback) == original
+2 -1
View File
@@ -780,7 +780,8 @@ class TransportPauseFeedback:
previous[9] and previous[11] and previous[13] and previous[6] == event_ns and
axis.sourceCarStateMonoTime >= previous[8] and stamp >= previous[2] and
previous[14] == producer and previous[15] == self.availability_epoch and
0 < self.lateral_source_ns <= now_ns and now_ns - self.lateral_source_ns <= AXIS_MAX_AGE_NS)
0 < self.lateral_source_ns <= previous[8] <= previous[2] <= now_ns <= previous[4] and
now_ns - previous[8] <= AXIS_MAX_AGE_NS)
pending_withdrawal = bool(all_off and not any(event.softDisable or event.userDisable for event in events) and
not temporary_event and 0 < event_ns < axis.faultEventMonoTime <= stamp and
now_ns - axis.faultEventMonoTime <= AXIS_MAX_AGE_NS and
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "e85babf7279be72dc647b70a9128be20822dff6482032814608abff6c091ad2f", "schema_version": 1}
{"protected_inventory_sha256": "783693de8a5c20de962697ff67e21993d68783b1456e4fc51a3e650d10ea4790", "schema_version": 1}