mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
manager: test process exclusion (#29586)
* add test
* add comment
* Update selfdrive/manager/test/test_manager.py
* more accurate
old-commit-hash: 84b897cf44
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user