phi-friday / async-wrapper

async wrapper
https://async-wrapper.readthedocs.io
MIT License
0 stars 0 forks source link

test_completed_overwrite_task_group[trio] fails on aarch64 #2

Open mcepl opened 1 month ago

mcepl commented 1 month ago

Test suite passes on other architectures, but it fails on aarch64.

[   31s] =================================== FAILURES ===================================
[   31s] __________________ test_completed_overwrite_task_group[trio] ___________________
[   31s] [gw0] linux -- Python 3.10.15 /usr/bin/python3.10
[   31s] 
[   31s]     @pytest.mark.anyio
[   31s]     async def test_completed_overwrite_task_group():
[   31s]         result: list[int] = []
[   31s]         async with anyio.create_task_group() as task_group:
[   31s]             task_group.start_soon(sample_func2, 1, 3, result)
[   31s]             async with Completed(task_group) as completed:
[   31s]                 completed.start_soon(task_group, sample_func2, 2, 2)
[   31s]                 completed.start_soon(task_group, sample_func2, 3, 1)
[   31s]     
[   31s]                 result.extend([value async for value in completed])
[   31s]     
[   31s] >       assert result == [3, 2, 1]
[   31s] E       AssertionError: assert [1, 3, 2] == [3, 2, 1]
[   31s] E         
[   31s] E         At index 0 diff: 1 != 3
[   31s] E         
[   31s] E         Full diff:
[   31s] E           [
[   31s] E         +     1,
[   31s] E               3,...
[   31s] E         
[   31s] E         ...Full output truncated (3 lines hidden), use '-vv' to show
[   31s] 
[   31s] src/tests/test_wait.py:131: AssertionError
[   31s] =========================== short test summary info ============================
[   31s] FAILED src/tests/test_wait.py::test_completed_overwrite_task_group[trio] - As...
[   31s] =================== 1 failed, 493 passed, 2 skipped in 8.22s ===================

Complete build log

phi-friday commented 1 month ago

Interesting. I just checked it in a docker container, and it passed the test fine.

I wrote this code quite a while ago, so I'm not sure if it's accurate, but if this test code is throwing an error, it should be throwing an error in test_completed_without_task_group as well (since it's essentially the same thing).

Can you double-check this one more time?

phi-friday commented 1 month ago

Interesting. I just checked it in a docker container, and it passed the test fine.

I wrote this code quite a while ago, so I'm not sure if it's accurate, but if this test code is throwing an error, it should be throwing an error in test_completed_without_task_group as well (since it's essentially the same thing).

Can you double-check this one more time?

logs

❯ docker run -it --rm python:3.10.15-bookworm bash
root@d901008acabb:/# git clone https://github.com/phi-friday/async-wrapper.git
Cloning into 'async-wrapper'...
remote: Enumerating objects: 2023, done.
remote: Counting objects: 100% (363/363), done.
remote: Compressing objects: 100% (197/197), done.
remote: Total 2023 (delta 216), reused 282 (delta 152), pack-reused 1660 (from 1)
Receiving objects: 100% (2023/2023), 373.78 KiB | 4.61 MiB/s, done.
Resolving deltas: 100% (1181/1181), done.
root@d901008acabb:/# cd async-wrapper/
root@d901008acabb:/async-wrapper# curl -LsSf https://astral.sh/uv/install.sh | sh
downloading uv 0.4.18 aarch64-unknown-linux-gnu
installing to /root/.cargo/bin
  uv
  uvx
everything's installed!

To add $HOME/.cargo/bin to your PATH, either restart your shell or run:

    source $HOME/.cargo/env (sh, bash, zsh)
    source $HOME/.cargo/env.fish (fish)
root@d901008acabb:/async-wrapper# source $HOME/.cargo/env
root@d901008acabb:/async-wrapper# uv sync
Using CPython 3.10.15 interpreter at: /usr/local/bin/python
Creating virtual environment at: .venv
Resolved 91 packages in 3.15s
   Built async-wrapper @ file:///async-wrapper
Prepared 61 packages in 9.00s
Installed 61 packages in 79ms
 + aiosqlite==0.20.0
 + anyio==4.6.0
 + asttokens==2.4.1
 + async-wrapper==0.10.1.dev1+g2072e8f (from file:///async-wrapper)
 + attrs==24.2.0
 + cfgv==3.4.0
 + comm==0.2.2
 + coverage==7.6.1
 + debugpy==1.8.6
 + decorator==5.1.1
 + distlib==0.3.8
 + exceptiongroup==1.2.2
 + execnet==2.1.1
 + executing==2.1.0
 + filelock==3.16.1
 + greenlet==3.1.1
 + identify==2.6.1
 + idna==3.10
 + iniconfig==2.0.0
 + ipykernel==6.29.5
 + ipython==8.18.1
 + jedi==0.19.1
 + jupyter-client==8.6.3
 + jupyter-core==5.7.2
 + matplotlib-inline==0.1.7
 + nest-asyncio==1.6.0
 + nodeenv==1.9.1
 + outcome==1.3.0.post0
 + packaging==24.1
 + parso==0.8.4
 + pastel==0.2.1
 + pexpect==4.9.0
 + platformdirs==4.3.6
 + pluggy==1.5.0
 + poethepoet==0.29.0
 + pre-commit==3.8.0
 + prompt-toolkit==3.0.48
 + psutil==6.0.0
 + ptyprocess==0.7.0
 + pure-eval==0.2.3
 + pygments==2.18.0
 + pytest==8.3.3
 + pytest-cov==5.0.0
 + pytest-xdist==3.6.1
 + python-dateutil==2.9.0.post0
 + pyyaml==6.0.2
 + pyzmq==26.2.0
 + ruff==0.6.4
 + six==1.16.0
 + sniffio==1.3.1
 + sortedcontainers==2.4.0
 + sqlalchemy==2.0.35
 + stack-data==0.6.3
 + tomli==2.0.2
 + tornado==6.4.1
 + traitlets==5.14.3
 + trio==0.26.2
 + typing-extensions==4.12.2
 + uvloop==0.20.0
 + virtualenv==20.26.6
 + wcwidth==0.2.13
root@d901008acabb:/async-wrapper# uv run pytest src/tests/test_wait.py -vv
============================= test session starts ==============================
platform linux -- Python 3.10.15, pytest-8.3.3, pluggy-1.5.0 -- /async-wrapper/.venv/bin/python
cachedir: .pytest_cache
rootdir: /async-wrapper
configfile: pyproject.toml
plugins: cov-5.0.0, xdist-3.6.1, anyio-4.6.0
4 workers [36 items]
scheduling tests via LoadScheduling

src/tests/test_wait.py::test_wait_many[asyncio]
src/tests/test_wait.py::test_waiter[asyncio]
src/tests/test_wait.py::test_waiter_reuse_overwrite[asyncio]
src/tests/test_wait.py::test_completed_without_task_group[asyncio]
[gw0] [  2%] PASSED src/tests/test_wait.py::test_waiter_reuse_overwrite[asyncio]
[gw1] [  5%] PASSED src/tests/test_wait.py::test_waiter[asyncio]
src/tests/test_wait.py::test_wait_for[asyncio]
[gw0] [  8%] PASSED src/tests/test_wait.py::test_wait_for[asyncio]
src/tests/test_wait.py::test_waiter_reuse[asyncio]
src/tests/test_wait.py::test_completed_overwrite_diff_task_group[asyncio]
[gw0] [ 11%] PASSED src/tests/test_wait.py::test_completed_overwrite_diff_task_group[asyncio]
src/tests/test_wait.py::test_completed_no_task_group[asyncio]
[gw3] [ 13%] PASSED src/tests/test_wait.py::test_wait_many[asyncio]
[gw1] [ 16%] PASSED src/tests/test_wait.py::test_waiter_reuse[asyncio]
[gw0] [ 19%] PASSED src/tests/test_wait.py::test_completed_no_task_group[asyncio]
src/tests/test_wait.py::test_waiter[asyncio-uvloop]
src/tests/test_wait.py::test_completed_with_task_group[asyncio]
src/tests/test_wait.py::test_completed_without_enter[asyncio]
[gw1] [ 22%] PASSED src/tests/test_wait.py::test_completed_without_enter[asyncio]
[gw0] [ 25%] PASSED src/tests/test_wait.py::test_waiter[asyncio-uvloop]
src/tests/test_wait.py::test_completed_after_exit[asyncio]
src/tests/test_wait.py::test_waiter_reuse[asyncio-uvloop]
[gw0] [ 27%] PASSED src/tests/test_wait.py::test_waiter_reuse[asyncio-uvloop]
src/tests/test_wait.py::test_wait_many[asyncio-uvloop]
[gw0] [ 30%] PASSED src/tests/test_wait.py::test_wait_many[asyncio-uvloop]
src/tests/test_wait.py::test_completed_with_task_group[asyncio-uvloop]
[gw1] [ 33%] PASSED src/tests/test_wait.py::test_completed_after_exit[asyncio]
src/tests/test_wait.py::test_wait_for[asyncio-uvloop]
[gw1] [ 36%] PASSED src/tests/test_wait.py::test_wait_for[asyncio-uvloop]
src/tests/test_wait.py::test_completed_overwrite_task_group[asyncio-uvloop]
[gw2] [ 38%] PASSED src/tests/test_wait.py::test_completed_without_task_group[asyncio]
src/tests/test_wait.py::test_completed_overwrite_task_group[asyncio]
[gw3] [ 41%] PASSED src/tests/test_wait.py::test_completed_with_task_group[asyncio]
src/tests/test_wait.py::test_waiter_reuse_overwrite[asyncio-uvloop]
[gw3] [ 44%] PASSED src/tests/test_wait.py::test_waiter_reuse_overwrite[asyncio-uvloop]
src/tests/test_wait.py::test_completed_without_enter[asyncio-uvloop]
[gw3] [ 47%] PASSED src/tests/test_wait.py::test_completed_without_enter[asyncio-uvloop]
src/tests/test_wait.py::test_completed_after_exit[asyncio-uvloop]
[gw0] [ 50%] PASSED src/tests/test_wait.py::test_completed_with_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_completed_without_task_group[asyncio-uvloop]
[gw1] [ 52%] PASSED src/tests/test_wait.py::test_completed_overwrite_task_group[asyncio-uvloop]
[gw2] [ 55%] PASSED src/tests/test_wait.py::test_completed_overwrite_task_group[asyncio]
[gw3] [ 58%] PASSED src/tests/test_wait.py::test_completed_after_exit[asyncio-uvloop]
src/tests/test_wait.py::test_completed_no_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_completed_overwrite_diff_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_waiter[trio]
[gw1] [ 61%] PASSED src/tests/test_wait.py::test_completed_overwrite_diff_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_waiter_reuse_overwrite[trio]
[gw2] [ 63%] PASSED src/tests/test_wait.py::test_completed_no_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_wait_for[trio]
[gw0] [ 66%] PASSED src/tests/test_wait.py::test_completed_without_task_group[asyncio-uvloop]
src/tests/test_wait.py::test_waiter_reuse[trio]
[gw1] [ 69%] PASSED src/tests/test_wait.py::test_waiter_reuse_overwrite[trio]
[gw2] [ 72%] PASSED src/tests/test_wait.py::test_wait_for[trio]
[gw0] [ 75%] PASSED src/tests/test_wait.py::test_waiter_reuse[trio]
src/tests/test_wait.py::test_completed_overwrite_task_group[trio]
src/tests/test_wait.py::test_completed_without_task_group[trio]
src/tests/test_wait.py::test_completed_with_task_group[trio]
[gw3] [ 77%] PASSED src/tests/test_wait.py::test_waiter[trio]
src/tests/test_wait.py::test_wait_many[trio]
[gw3] [ 80%] PASSED src/tests/test_wait.py::test_wait_many[trio]
src/tests/test_wait.py::test_completed_after_exit[trio]
[gw3] [ 83%] PASSED src/tests/test_wait.py::test_completed_after_exit[trio]
[gw0] [ 86%] PASSED src/tests/test_wait.py::test_completed_overwrite_task_group[trio]
[gw2] [ 88%] PASSED src/tests/test_wait.py::test_completed_without_task_group[trio]
src/tests/test_wait.py::test_completed_overwrite_diff_task_group[trio]
[gw1] [ 91%] PASSED src/tests/test_wait.py::test_completed_with_task_group[trio]
src/tests/test_wait.py::test_completed_no_task_group[trio]
src/tests/test_wait.py::test_completed_without_enter[trio]
[gw1] [ 94%] PASSED src/tests/test_wait.py::test_completed_without_enter[trio]
[gw2] [ 97%] PASSED src/tests/test_wait.py::test_completed_overwrite_diff_task_group[trio]
[gw0] [100%] PASSED src/tests/test_wait.py::test_completed_no_task_group[trio]

---------- coverage: platform linux, python 3.10.15-final-0 ----------
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

============================== 36 passed in 1.11s ==============================
root@d901008acabb:/async-wrapper#
mcepl commented 1 month ago

Is this aarch64? I have no problems on x86_64 either.

phi-friday commented 1 month ago

Is this aarch64? I have no problems on x86_64 either.

You can see in the log that it's aarch64.

mcepl commented 1 month ago

Silly me.