Skip to content

Commit

Permalink
fix that up
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Feb 11, 2025
1 parent fc89f3c commit 2469fdc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions selfdrive/test/test_onroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
"wideRoadCameraState": [1.5, 0.35],
}

LOGS_SIZE_RATE = {
"qlog.zst": 0.0083,
"rlog.zst": 0.135,
"qcamera.ts": 0.03828,
LOGS_SIZE = { # MB per segment
"qlog.zst": 0.5,
"rlog.zst": 8.1,
"qcamera.ts": 2.3,
}
LOGS_SIZE_RATE.update(dict.fromkeys(['ecamera.hevc', 'fcamera.hevc', 'dcamera.hevc'], 1.2740))
LOGS_SIZE.update(dict.fromkeys(['ecamera.hevc', 'fcamera.hevc', 'dcamera.hevc'], 76.5))


def cputime_total(ct):
Expand Down Expand Up @@ -213,12 +213,13 @@ def test_cloudlog_size(self):
big_logs = [f for f, n in cnt.most_common(3) if n / sum(cnt.values()) > 30.]
assert len(big_logs) == 0, f"Log spam: {big_logs}"

def test_log_sizes(self):
def test_log_sizes(self, subtests):
for f, sz in self.log_sizes.items():
rate = LOGS_SIZE_RATE[f.name]
minn = rate * TEST_DURATION * 0.8
rate = LOGS_SIZE[f.name]/60.
minn = rate * TEST_DURATION * 0.5
maxx = rate * TEST_DURATION * 1.2
assert minn < sz < maxx
with subtests.test(file=f.name):
assert minn < sz < maxx

def test_ui_timings(self):
result = "\n"
Expand Down

0 comments on commit 2469fdc

Please sign in to comment.