Set timeout for both test function only and test function + all fixture setup and teardown
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia esaminando la configurazione esistente timeout_func_only e la gestione dei timeout per le funzioni di test, i fixture, il setup e il teardown. Definisci come configurare e verificare timeout separati, solo per le funzioni e per l’intero test, sia per l’esecuzione rapida dei test sia per il caso d’uso CI.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It would be nice if it was possible to set a separate timeout for calling the function instead of just setting that the timeout applies only to the function. Currently I can set timeout_func_only = true in pyproject.toml, but that means that all timeouts apply only to the test function.
Concretely, The problem is that I have two kind of timeouts.
I would like to enforce that a selection of tests are fast when fixtures that can be cached are ignored. I currently run those like this:
pytest -m "not slow" tests/ --timeout=10
with timeout_func_only = true in pyproject.toml.
This is to maintain a set (the majority in our case, more than 2k), can be ran quickly (takes less than 40s with caching and pytest-xdist). Each of those tests should take less than 0.1s so a generous timeout of 10s seems appropriate. Only setting a session timeout for this run is not as reliable as it can vary widely because of pytest-xdist.
However, when running all tests in a CI runner, I need to set an appropriate large timeout (roughly 300s) for each test in order to avoid that a hanging test racks up billable minutes. A session timeout works, but needs to be set to an even larger timeout in order to avoid spurious fails due to variation. For this use case I would like to have timeout_func_only = false as slow fixtures matters for billable minutes.
- Lingua principale
- Python
- Stelle
- 258
- Fork
- 69
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-timeout
-
PR #200 introduced breaking change - `timeout` value in config is incompatible with older versions Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
pytest-dev/pytest-timeout#203 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
pytest-dev/pytest-timeout#189 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
pytest-dev/pytest-timeout#181 · 4 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
pytest-dev/pytest-timeout#178 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
pytest-dev/pytest-timeout#173 ·
Tutte le issue di pytest-dev/pytest-timeout
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100