mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 17:43:54 +08:00
tici: remove power save test, it's testing the wrong thing
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -232,7 +232,6 @@ node {
|
|||||||
["test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"],
|
["test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"],
|
||||||
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py", ["panda/", "selfdrive/pandad/"]],
|
["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py", ["panda/", "selfdrive/pandad/"]],
|
||||||
["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"],
|
["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"],
|
||||||
["test hw", "pytest system/hardware/tici/tests/test_hardware.py"],
|
|
||||||
["test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py"],
|
["test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py"],
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
import pytest
|
|
||||||
import time
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
from openpilot.system.hardware.tici.hardware import Tici
|
|
||||||
|
|
||||||
HARDWARE = Tici()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.tici
|
|
||||||
class TestHardware:
|
|
||||||
|
|
||||||
def test_power_save_time(self):
|
|
||||||
ts = {True: [], False: []}
|
|
||||||
for _ in range(5):
|
|
||||||
for on in (True, False):
|
|
||||||
st = time.monotonic()
|
|
||||||
HARDWARE.set_power_save(on)
|
|
||||||
ts[on].append(time.monotonic() - st)
|
|
||||||
|
|
||||||
# disabling power save is the main time-critical one
|
|
||||||
assert 0.1 < np.mean(ts[False]) < 0.15
|
|
||||||
assert max(ts[False]) < 0.2
|
|
||||||
|
|
||||||
assert 0.1 < np.mean(ts[True]) < 0.35
|
|
||||||
assert max(ts[True]) < 0.4
|
|
||||||
Reference in New Issue
Block a user