TestTimeout abandons three delay/10 requests and later tests wait out the server
@hananbahi527 ci sta già lavorando.
Dal 14/10/2026.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 90/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia da tests/test_requests.py:2539 e :2573 in TestTimeout, dove vengono utilizzati gli endpoint delay/10. Modifica i delay in delay/3 e delay/1, mantenendo i timeout e le assertions del client. Esegui i due test di timeout con TestTimeout::test_encoded_methods e conferma che la suite eviti le attese non necessarie del server con gli stessi risultati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
TestTimeout makes three requests to httpbin("delay/10") and abandons all of them:
tests/test_requests.py:2539,test_stream_timeout,timeout=2.0tests/test_requests.py:2573,test_read_timeout, parametrized,timeout=0.1(two params)
The client raises at 2.0s and 0.1s, but the pytest-httpbin server keeps sleeping the full 10 seconds and serves requests serially. The next test that needs the server blocks until those sleeps finish.
$ pytest "tests/test_requests.py::TestTimeout::test_encoded_methods" -p no:randomly
1 passed in 0.56s
$ pytest "tests/test_requests.py::TestTimeout::test_read_timeout" \
"tests/test_requests.py::TestTimeout::test_encoded_methods" \
-p no:randomly --durations=5
19.79s call tests/test_requests.py::TestTimeout::test_encoded_methods
0.11s call tests/test_requests.py::TestTimeout::test_read_timeout[timeout1]
0.10s call tests/test_requests.py::TestTimeout::test_read_timeout[timeout0]
3 passed in 20.55s
test_encoded_methods is one line (requests.request(b"GET", httpbin("get"))). The 19.79s is 2 x 10s of server sleep minus the 0.2s the two clients used. In a full run the cost lands on whichever tests happen to follow:
19.35s call TestTimeout::test_encoded_methods
8.00s call TestTimeout::test_none_timeout[None]
Both call sites need the server to outlast the client timeout, not to sleep for 10 seconds. Lowering the delays leaves the assertions unchanged:
- line 2539,
delay/10todelay/3(client timeout 2.0) - line 2573,
delay/10todelay/1(client timeout 0.1)
With that change, TestTimeout goes from 30.56s to 5.70s and the full suite from 167.44s to 142.04s, with the same results either way: 630 passed, 3 skipped, 1 xpassed. The single failure in both runs is TestPreparingURLs::test_different_connection_pool_for_tls_settings_verify_bundle_unexpired_cert, which is unrelated and fails before the change as well.
Measured at 611c616 on Windows 11, Python 3.14.2, pytest 9.1.1.
- Lingua principale
- Python
- Stelle
- 54.6k
- Fork
- 11.5k
- Merge medio
- 18m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 psf/requests
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Docs: link security vulnerability reports from CONTRIBUTING.mdForse già presa @young1lin l’ha presa 9 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
Tutte le issue di psf/requests
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FinanceFlash/unvibecode#509 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
modelcontextprotocol/python-sdk#3821 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Log-odds calibration uses upper middle score instead of median for even candidate setsForse già presa @flysheep-ai l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno