Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openpilot/selfdrive/selfdrived/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def posenet_invalid_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.Sub
def process_not_running_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert:
not_running = [p.name for p in sm['managerState'].processes if not p.running and p.shouldBeRunning]
msg = ', '.join(not_running)
return NoEntryAlert(msg, alert_text_1="Process Not Running")
return NoEntryAlert(msg, alert_text_1="Process Not Running", priority=Priority.HIGH)


def comm_issue_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert:
Expand Down
8 changes: 7 additions & 1 deletion openpilot/selfdrive/selfdrived/tests/test_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from openpilot.cereal.messaging import SubMaster
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
from openpilot.selfdrive.selfdrived.events import Alert, EVENTS, ET
from openpilot.selfdrive.selfdrived.events import Alert, EVENTS, ET, process_not_running_alert
from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS

Expand Down Expand Up @@ -70,6 +70,12 @@ def test_alert_sanity_check(self):
if event_type not in (ET.WARNING, ET.PERMANENT, ET.PRE_ENABLE):
assert a.creation_delay == 0.

def test_process_not_running_alert_has_priority(self):
process_alert = process_not_running_alert(self.CP, self.CS, self.sm, False, 0, None)
steer_alert = EVENTS[log.OnroadEvent.EventName.steerUnavailable][ET.NO_ENTRY]

assert process_alert.priority > steer_alert.priority

def test_offroad_alerts(self):
params = Params()
for a in self.offroad_alerts:
Expand Down
Loading