test_onroad: assert the procs that use the GPU (#30359)

* test gpu

* keep it localiized

* has to be later

* reduce diff

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: ddbdaf3cf9
testing-closet
Justin Newberry 2 years ago committed by GitHub
parent c8bcace7c0
commit 0785258458
  1. 7
      selfdrive/test/test_onroad.py

@ -3,6 +3,8 @@ import bz2
import math
import json
import os
import pathlib
import psutil
import shutil
import subprocess
import time
@ -151,6 +153,8 @@ class TestOnroad(unittest.TestCase):
cls.segments = cls.segments[:-1]
finally:
cls.gpu_procs = {psutil.Process(int(f.name)).name() for f in pathlib.Path('/sys/devices/virtual/kgsl/kgsl/proc/').iterdir() if f.is_dir()}
if proc is not None:
proc.terminate()
if proc.wait(60) is None:
@ -296,6 +300,9 @@ class TestOnroad(unittest.TestCase):
# expected to go up while the MSGQ buffers fill up
self.assertLessEqual(max(mems) - min(mems), 3.0)
def test_gpu_usage(self):
self.assertEqual(self.gpu_procs, {"weston", "_ui", "mapsd", "camerad", "selfdrive.modeld.modeld"})
def test_camera_processing_time(self):
result = "\n"
result += "------------------------------------------------\n"

Loading…
Cancel
Save