manager: test process exclusion (#29586)

* add test

* add comment

* Update selfdrive/manager/test/test_manager.py

* more accurate
old-commit-hash: 84b897cf44104d964834979d6fc34822baa999bf
This commit is contained in:
Shane Smiskol
2023-08-24 00:34:36 -07:00
committed by GitHub
parent 0702e273cb
commit 8326f9f90c
+7
View File
@@ -16,6 +16,7 @@ os.environ['FAKEUPLOAD'] = "1"
MAX_STARTUP_TIME = 3
BLACKLIST_PROCS = ['manage_athenad', 'pandad', 'pigeond']
class TestManager(unittest.TestCase):
def setUp(self):
os.environ['PASSIVE'] = '0'
@@ -32,6 +33,10 @@ class TestManager(unittest.TestCase):
os.environ['PREPAREONLY'] = '1'
manager.main()
def test_blacklisted_procs(self):
# TODO: ensure there are blacklisted procs until we have a dedicated test
self.assertTrue(len(BLACKLIST_PROCS), "No blacklisted procs to test not_run")
def test_startup_time(self):
for _ in range(10):
start = time.monotonic()
@@ -59,6 +64,8 @@ class TestManager(unittest.TestCase):
self.assertTrue(state.running, f"{p.name} not running")
exit_code = p.stop(retry=False)
self.assertNotIn(p.name, BLACKLIST_PROCS, f"{p.name} was started")
# TODO: mapsd should exit cleanly
if p.name == "mapsd":
continue