test_onroad: absolute memory usage test (#36885)
* test_onroad: absolute memory usage test * show msgq size * reduce a little * bump msgq * Revert "bump msgq" This reverts commit 683d0ae9fc754f7b72e2bc4b256e9a3b0a60a127.
This commit is contained in:
Submodule msgq_repo updated: a16cf1f608...92999f6bc1
@@ -121,6 +121,7 @@ class TestOnroad:
|
||||
params.put_bool("RecordFront", True)
|
||||
set_params_enabled()
|
||||
os.environ['REPLAY'] = '1'
|
||||
os.environ['MSGQ_PREALLOC'] = '1'
|
||||
os.environ['TESTING_CLOSET'] = '1'
|
||||
if os.path.exists(Paths.log_root()):
|
||||
shutil.rmtree(Paths.log_root())
|
||||
@@ -283,11 +284,12 @@ class TestOnroad:
|
||||
print("------------------------------------------------")
|
||||
offset = int(SERVICE_LIST['deviceState'].frequency * LOG_OFFSET)
|
||||
mems = [m.deviceState.memoryUsagePercent for m in self.msgs['deviceState'][offset:]]
|
||||
print("Memory usage: ", mems)
|
||||
print("Overall memory usage: ", mems)
|
||||
print("MSGQ (/dev/shm/) usage: ", subprocess.check_output(["du", "-hs", "/dev/shm"]).split()[0].decode())
|
||||
|
||||
# check for big leaks. note that memory usage is
|
||||
# expected to go up while the MSGQ buffers fill up
|
||||
assert np.average(mems) <= 85, "Average memory usage above 85%"
|
||||
assert np.average(mems) <= 82, "Average memory usage above 85%"
|
||||
assert np.max(np.diff(mems)) <= 4, "Max memory increase too high"
|
||||
assert np.average(np.diff(mems)) <= 1, "Average memory increase too high"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user