Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.66k stars 150 forks source link

Test failure on slow processors? #128

Open davesteele opened 2 years ago

davesteele commented 2 years ago

Unit tests have failed on ppc64el hardware:

https://ci.debian.net/data/autopkgtest/unstable/ppc64el/a/aiofiles/18419050/log.gz

autopkgtest [08:17:49]: test unittests.py: [-----------------------
============================= test session starts ==============================
platform linux -- Python 3.9.10, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/autopkgtest-lxc.9mzzz2i1/downtmp/build.Jix/src
plugins: asyncio-0.16.0
collected 155 items

tests/test_os.py ......                                                  [  3%]
tests/test_simple.py ..                                                  [  5%]
tests/threadpool/test_binary.py ........................................ [ 30%]
...........................................................              [ 69%]
tests/threadpool/test_concurrency.py .                                   [ 69%]
tests/threadpool/test_open.py ...                                        [ 71%]
tests/threadpool/test_text.py .......................................... [ 98%]
..                                                                       [100%]

============================= 155 passed in 1.76s ==============================
Task was destroyed but it is pending!
task: <Task pending name='Task-123' coro=<test_slow_file.<locals>.serve_file() running at /tmp/autopkgtest-lxc.9mzzz2i1/downtmp    /build.Jix/src/tests/threadpool/test_concurrency.py:37> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at     /usr/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x7fff84d62070>()]>>
autopkgtest [08:17:51]: test unittests.py: -----------------------]
autopkgtest [08:17:52]: test unittests.py:  - - - - - - - - - - results - - - - - - - - - -
unittests.py         FAIL stderr: Task was destroyed but it is pending!
autopkgtest [08:17:52]: test unittests.py:  - - - - - - - - - - stderr - - - - - - - - - -
Task was destroyed but it is pending!
task: <Task pending name='Task-123' coro=<test_slow_file.<locals>.serve_file() running at /tmp/autopkgtest-lxc.9mzzz2i1/downtmp    /build.Jix/src/tests/threadpool/test_concurrency.py:37> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x7fff84d62070>()]>>

Does test_slow_file() need to verify serve_file() is drained before cleaning up?

davesteele commented 2 years ago

This has come up before. See 995bbea472

Tinche commented 2 years ago

We used to have ppc64e tests back on Travis, but I don't think GitHub supports them.

Anyway, looks like the tests pass but there's some stderr output that's unexpected?

davesteele commented 2 years ago

Looks like another race.