Skip to content

Commit 81a1601

Browse files
pd0wmrbiasini
authored andcommitted
Fix timeout in longitudinal test (commaai#772)
* Fix timeout in longitudinal test
1 parent 9e22d17 commit 81a1601

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

selfdrive/controls/controlsd.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
import os
23
import gc
34
import capnp
45
from cereal import car, log
@@ -440,7 +441,8 @@ def controlsd_thread(gctx=None):
440441
logcan.close()
441442

442443
# TODO: Use the logcan socket from above, but that will currenly break the tests
443-
can_sock = messaging.sub_sock(service_list['can'].port, timeout=100)
444+
can_timeout = None if os.environ.get('NO_CAN_TIMEOUT', False) else 100
445+
can_sock = messaging.sub_sock(service_list['can'].port, timeout=can_timeout)
444446

445447
car_recognized = CP.carName != 'mock'
446448
# If stock camera is disconnected, we loaded car controls and it's not chffrplus

selfdrive/test/tests/plant/test_longitudinal.py

+1
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def setup_output():
325325
class LongitudinalControl(unittest.TestCase):
326326
@classmethod
327327
def setUpClass(cls):
328+
os.environ['NO_CAN_TIMEOUT'] = "1"
328329

329330
setup_output()
330331

0 commit comments

Comments
 (0)