agronholm / agronholm/anyio

test_shielded_cancel_sleep_time is unstable on slow build machines and slow platforms (e.g., ppc64le)

Aperta
#1,263 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
2.5k
Fork
260
Merge medio
2g 8h
PR unite (30g)
19

Descrizione

### Things to check first

- [x] I have searched the existing issues and didn't find my bug already reported there

- [x] I have checked that my bug is still present in the latest release

### AnyIO version

4.14.2

### Python version

3.14.6

### What happened?

When packaging for openSUSE/Factory I got this persistent failure of `test_shielded_cancel_sleep_time`:

```
___________________ test_shielded_cancel_sleep_time[asyncio] ___________________
[ 554s] + Exception Group Traceback (most recent call last):
[ 554s] | File "/home/abuild/rpmbuild/BUILD/python-anyio-test-4.14.2-build/anyio-4.14.2/tests/test_taskgroups.py", line 1450, in test_shielded_cancel_sleep_time
[ 554s] | async with create_task_group() as tg:
[ 554s] | ~~~~~~~~~~~~~~~~~^^
[ 554s] | File "/usr/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 815, in __aexit__
[ 554s] | raise BaseExceptionGroup(
[ 554s] | "unhandled errors in a TaskGroup", self._exceptions
[ 554s] | ) from None
[ 554s] | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
[ 554s] +-+---------------- 1 ----------------
[ 554s] | Traceback (most recent call last):
[ 554s] | File "/home/abuild/rpmbuild/BUILD/python-anyio-test-4.14.2-build/anyio-4.14.2/tests/test_taskgroups.py", line 1458, in test_shielded_cancel_sleep_time
[ 554s] | assert (time.process_time() - process_time) < hang_time
[ 554s] | AssertionError: assert (183.655833728 - 183.448973366) < 0.2
[ 554s] | + where 183.655833728 = ()
[ 554s] | + where = time.process_time
[ 554s] +------------------------------------
```

### How can we reproduce the bug?

Running the test suite on overloaded build system (OpenSUSE OpenBuild system in my case) with slow processor (`ppc64le` in my case)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with tests/test_taskgroups.py, especially test_shielded_cancel_sleep_time around lines 1450-1458, and run that test on a slow or overloaded machine. Check how its process-time assertion behaves on the asyncio backend. Done means the test remains meaningful while no longer failing spuriously on slow platforms such as ppc64le.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
testing-qa
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.