Skip to content

Commit

Permalink
Revert "test_onroad: use zstd compression (#33100)"
Browse files Browse the repository at this point in the history
This reverts commit 4caecf2.
  • Loading branch information
sshane committed Jul 27, 2024
1 parent 4caecf2 commit d34e5ec
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions selfdrive/test/test_onroad.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import bz2
import math
import json
import os
Expand All @@ -8,7 +9,6 @@
import subprocess
import time
import numpy as np
import zstd
from collections import Counter, defaultdict
from functools import cached_property
from pathlib import Path
Expand All @@ -20,10 +20,9 @@
from openpilot.common.timeout import Timeout
from openpilot.common.params import Params
from openpilot.selfdrive.controls.lib.events import EVENTS, ET
from openpilot.selfdrive.test.helpers import set_params_enabled, release_only
from openpilot.system.hardware import HARDWARE
from openpilot.selfdrive.test.helpers import set_params_enabled, release_only
from openpilot.system.hardware.hw import Paths
from openpilot.system.loggerd.uploader import LOG_COMPRESSION_LEVEL
from openpilot.tools.lib.logreader import LogReader

"""
Expand Down Expand Up @@ -167,10 +166,10 @@ def setup_class(cls):
cls.log_sizes = {}
for f in cls.log_path.iterdir():
assert f.is_file()
cls.log_sizes[f] = f.stat().st_size / 1e6
cls.log_sizes[f] = f.stat().st_size / 1e6
if f.name in ("qlog", "rlog"):
with open(f, 'rb') as ff:
cls.log_sizes[f] = len(zstd.compress(ff.read(), LOG_COMPRESSION_LEVEL)) / 1e6
cls.log_sizes[f] = len(bz2.compress(ff.read())) / 1e6


@cached_property
Expand Down Expand Up @@ -207,7 +206,7 @@ def test_log_sizes(self):
if f.name == "qcamera.ts":
assert 2.15 < sz < 2.35
elif f.name == "qlog":
assert 0.4 < sz < 0.5
assert 0.4 < sz < 0.6
elif f.name == "rlog":
assert 5 < sz < 50
elif f.name.endswith('.hevc'):
Expand Down

0 comments on commit d34e5ec

Please sign in to comment.