Fix timeout in longitudinal test (#772)

* Fix timeout in longitudinal test
old-commit-hash: 5808958fb2
commatwo_master
Willem Melching 6 years ago committed by rbiasini
parent 3835061760
commit 7609fa5d17
  1. 4
      selfdrive/controls/controlsd.py
  2. 1
      selfdrive/test/tests/plant/test_longitudinal.py

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import os
import gc import gc
import capnp import capnp
from cereal import car, log from cereal import car, log
@ -440,7 +441,8 @@ def controlsd_thread(gctx=None):
logcan.close() logcan.close()
# TODO: Use the logcan socket from above, but that will currenly break the tests # TODO: Use the logcan socket from above, but that will currenly break the tests
can_sock = messaging.sub_sock(service_list['can'].port, timeout=100) can_timeout = None if os.environ.get('NO_CAN_TIMEOUT', False) else 100
can_sock = messaging.sub_sock(service_list['can'].port, timeout=can_timeout)
car_recognized = CP.carName != 'mock' car_recognized = CP.carName != 'mock'
# If stock camera is disconnected, we loaded car controls and it's not chffrplus # If stock camera is disconnected, we loaded car controls and it's not chffrplus

@ -325,6 +325,7 @@ def setup_output():
class LongitudinalControl(unittest.TestCase): class LongitudinalControl(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
os.environ['NO_CAN_TIMEOUT'] = "1"
setup_output() setup_output()

Loading…
Cancel
Save