boot time test (#1909)

* test

* usb serial

* just test for now

* time

* close

* close after
This commit is contained in:
Adeeb Shihadeh 2024-03-21 20:28:44 -07:00 committed by GitHub
parent de061e4f73
commit 8a845b973e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -82,7 +82,7 @@ pipeline {
["build", "scons -j4"],
["flash", "cd tests/ && ./reflash_internal_panda.py"],
["flash jungle", "cd board/jungle && ./flash.py"],
["test", "cd tests/hitl && HW_TYPES=6 pytest -n0 --durations=0 [2-7]*.py -k 'not test_send_recv'"],
["test", "cd tests/hitl && HW_TYPES=6 pytest -n0 --durations=0 [2-9]*.py -k 'not test_send_recv'"],
])
}
}

View File

@ -433,6 +433,8 @@ class Panda:
self._handle.controlWrite(Panda.REQUEST_IN, 0xd8, 0, 0, b'', timeout=timeout, expect_disconnect=True)
except Exception:
pass
self.close()
if not enter_bootloader and reconnect:
self.reconnect()

10
tests/hitl/8_misc.py Normal file
View File

@ -0,0 +1,10 @@
import time
from panda import Panda
def test_boot_time(p):
# boot time should be instant
st = time.monotonic()
p.reset(reconnect=False)
assert Panda.wait_for_panda(p.get_usb_serial(), timeout=3.0)
assert time.monotonic() - st < 3.0