Pytest: reenable gc in pytest fixture + re-combine jenkins car tests (#31351)

* Revert "jenkins: spilt car tests in two steps (#31346)"

This reverts commit 03bf426f569151598070a073f658a323eb03b9db.

* enable gc

* codespell

* useless comment
old-commit-hash: 6933d0560a
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent acc2a03812
commit 378c5cb50b
  1. 5
      Jenkinsfile
  2. 6
      conftest.py

5
Jenkinsfile vendored

@ -272,9 +272,8 @@ node {
'car tests': { 'car tests': {
pcStage("car tests") { pcStage("car tests") {
sh label: "build", script: "selfdrive/manager/build.py" sh label: "build", script: "selfdrive/manager/build.py"
sh label: "test_models", script: "INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt \ sh label: "run car tests", script: "cd selfdrive/car/tests && MAX_EXAMPLES=300 INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 \
pytest selfdrive/car/tests/test_models.py" INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt pytest test_models.py test_car_interfaces.py"
sh label: "test_car_interfaces", script: "MAX_EXAMPLES=300 pytest selfdrive/car/tests/test_car_interfaces.py"
} }
}, },

@ -1,3 +1,4 @@
import gc
import os import os
import pytest import pytest
import random import random
@ -45,6 +46,11 @@ def openpilot_function_fixture(request):
# cleanup any started processes # cleanup any started processes
manager.manager_cleanup() manager.manager_cleanup()
# some processes disable gc for performance, re-enable here
if not gc.isenabled():
gc.enable()
gc.collect()
# If you use setUpClass, the environment variables won't be cleared properly, # If you use setUpClass, the environment variables won't be cleared properly,
# so we need to hook both the function and class pytest fixtures # so we need to hook both the function and class pytest fixtures
@pytest.fixture(scope="class", autouse=True) @pytest.fixture(scope="class", autouse=True)

Loading…
Cancel
Save