# general


09/12/2022, 10:16 AM
Hi, I am using pants inside a monorepo with hundrets of tests. When running pants test I recognized that each test takes about 7 secs. When using pytest it only takes 200ms. I saw someone else had simmilar problems so I tried the following steps: I saw that running --setup-only makes nearly no difference in execution time so clearly the setup takes too long and the actual test runs very fast. The output of --setup-only gets stuck at
SETUP    S django_db_setup (fixtures used: django_db_blocker, django_db_createdb, django_db_keepdb, django_db_modify_db_settings, django_db_use_migrations, django_test_environment)
for roughly 6 seconds which is 6/7 of the whole test duration. Running all test in this project would take hours when every tests needs 7-10 secs using pants. With pytest it takes 4 minutes. Does anyone know how to fix this issue or can I try other debugging steps? pytest.ini
Copy code
DJANGO_SETTINGS_MODULE = django_core.settings
# -- standard arguments:
Copy code
lockfile = "lockfiles/python/tools/pytest"
version = "pytest>=7.1.2,<7.2"
extra_requirements.add = [
config_discovery = true


09/12/2022, 12:58 PM
you are possibly hitting the only work-around I know of at the moment is to throw more hardware at it - in our CI we shard tests across 16 beefy worker machines


09/12/2022, 3:08 PM
Yeah, I think that is the case. You’re in a bad corner case where setup time dominates the single test run time. If you could comment on that issue with this information it will help prioritize the work to batch tests