diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index d82b450abd..a63a8d2df3 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -174,10 +174,10 @@ jobs: timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache run: ${{ env.RUN }} "scons -j$(nproc)" - name: Run unit tests - timeout-minutes: 15 + timeout-minutes: 1 run: | ${{ env.RUN }} "source selfdrive/test/setup_xvfb.sh && \ - $PYTEST --timeout 60 -m 'not slow' && \ + MAX_EXAMPLES=1 $PYTEST --timeout 60 -m 'not slow' && \ ./selfdrive/ui/tests/create_test_translations.sh && \ QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \ pytest ./selfdrive/ui/tests/test_translations.py" diff --git a/cereal/messaging/tests/test_pub_sub_master.py b/cereal/messaging/tests/test_pub_sub_master.py index 99965319eb..e9bc7a85cb 100644 --- a/cereal/messaging/tests/test_pub_sub_master.py +++ b/cereal/messaging/tests/test_pub_sub_master.py @@ -63,14 +63,13 @@ class TestSubMaster: def test_update_timeout(self): sock = random_sock() sm = messaging.SubMaster([sock,]) - for _ in range(5): - timeout = random.randrange(1000, 5000) - start_time = time.monotonic() - sm.update(timeout) - t = time.monotonic() - start_time - assert t >= timeout/1000. - assert t < 5 - assert not any(sm.updated.values()) + timeout = random.randrange(1000, 3000) + start_time = time.monotonic() + sm.update(timeout) + t = time.monotonic() - start_time + assert t >= timeout/1000. + assert t < 3 + assert not any(sm.updated.values()) def test_avg_frequency_checks(self): for poll in (True, False): diff --git a/system/tests/test_logmessaged.py b/system/tests/test_logmessaged.py index 3baf5300c0..03c13437bc 100644 --- a/system/tests/test_logmessaged.py +++ b/system/tests/test_logmessaged.py @@ -35,7 +35,7 @@ class TestLogmessaged: msgs = [f"abc {i}" for i in range(10)] for m in msgs: cloudlog.error(m) - time.sleep(3) + time.sleep(1) m = messaging.drain_sock(self.sock) assert len(m) == len(msgs) assert len(self._get_log_files()) >= 1 @@ -45,7 +45,7 @@ class TestLogmessaged: msg = "a"*3*1024*1024 for _ in range(n): cloudlog.info(msg) - time.sleep(3) + time.sleep(1) msgs = messaging.drain_sock(self.sock) assert len(msgs) == 0 diff --git a/tools/replay/tests/test_replay.cc b/tools/replay/tests/test_replay.cc index d350df570a..e4d8c3e5f0 100644 --- a/tools/replay/tests/test_replay.cc +++ b/tools/replay/tests/test_replay.cc @@ -136,7 +136,7 @@ std::string download_demo_route() { } -TEST_CASE("Local route") { +TEST_CASE("Getting route") { std::string data_dir = download_demo_route(); auto flags = GENERATE(0, REPLAY_FLAG_QCAMERA); @@ -148,16 +148,6 @@ TEST_CASE("Local route") { } } -TEST_CASE("Remote route") { - auto flags = GENERATE(0, REPLAY_FLAG_QCAMERA); - Route route(DEMO_ROUTE); - REQUIRE(route.load()); - REQUIRE(route.segments().size() == 13); - for (int i = 0; i < TEST_REPLAY_SEGMENTS; ++i) { - read_segment(i, route.at(i), flags); - } -} - TEST_CASE("seek_to") { QEventLoop loop; int seek_to = util::random_int(0, 2 * 59);