signals should be blocked in thread when using thread timeout method
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Individua l’implementazione del timeout basata su thread in pytest-timeout e leggi come viene avviato il relativo thread interno. Controlla il comportamento di signal.pthread_sigmask descritto nell’issue, quindi verifica che i segnali rimangano bloccati per il thread di timeout senza modificare il comportamento esistente del timeout.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Original report by Christopher Hunt (Bitbucket: chrahunt, GitHub: chrahunt).
Currently in Python it's only possible to change your signal disposition on a thread-specific basis using signal.pthread_sigmask. When a test depends on certain signals being blocked but we use the thread method for pytest-timeout, the signal is still received by the process via the internal thread maintained by pytest-timeout and it is then propagated to the main thread by the Python runtime.
The fix is to surround the thread start with something like
old_mask = signal.pthread_sigmask(signal.SIG_SETMASK, range(1, signal.NSIG))
t.start()
signal.pthread_sigmask(signal.SIG_SETMASK, old_mask)
This works because the signal mask is inherited by spawned threads, and also avoids a potential race condition if we were to set the signal mask inside the thread target function itself.
Currently I work around this issue by patching threading.Thread.start to do the same as above.
- 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#190 · 9 commenti ·
-
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 ·
Tutte le issue di pytest-dev/pytest-timeout
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100