vpelletier / python-libaio

Python wrapper for libaio
GNU Lesser General Public License v3.0
16 stars 6 forks source link

Do the tests actually pass in 0.9.0 #14

Closed hmaarrfk closed 3 years ago

hmaarrfk commented 3 years ago

Recreation steps:

  1. Ubuntu 21.10
  2. mamba/conda
    sudo apt install libaio1
    mamba create -c conda-forge --name py39 python=3.9 --yes
    conda activate py39
    pip install libaio

Other build logs can be found: https://github.com/conda-forge/python-libaio-feedstock/pull/7

$ python -m libaio.test -v
testFDsync (__main__.LibAIOTests)
FDSYNC was introduced in a later kernel version than READ/WRITE. ... ok
testFsync (__main__.LibAIOTests)
FSYNC was introduced in a later kernel version than READ/WRITE. ... ok
testPoll (__main__.LibAIOTests)
POLL was introduced in a later kernel version than FSYNC/FDSYNC. ... ok
testReadWrite (__main__.LibAIOTests)
Most baic functions: without these, libaio will not be of much use. ... ERROR

======================================================================
ERROR: testReadWrite (__main__.LibAIOTests)
Most baic functions: without these, libaio will not be of much use.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mark/mambaforge/envs/py39/lib/python3.9/site-packages/libaio/test.py", line 104, in testReadWrite
    io_context.getEvents(min_nr=None),
  File "/home/mark/mambaforge/envs/py39/lib/python3.9/site-packages/libaio/__init__.py", line 572, in getEvents
    return [
  File "/home/mark/mambaforge/envs/py39/lib/python3.9/site-packages/libaio/__init__.py", line 573, in <listcomp>
    self._eventToPython(event_buffer[x])
  File "/home/mark/mambaforge/envs/py39/lib/python3.9/site-packages/libaio/__init__.py", line 480, in _eventToPython
    aio_block, _ = self._submitted.pop(addressof(event.obj.contents))
KeyError: 139645070049392

----------------------------------------------------------------------
Ran 4 tests in 0.191s

FAILED (errors=1)
python -c "import libaio; print(libaio.__version__)"
0.9.0
$ mamba list
# packages in environment at /home/mark/mambaforge/envs/py39:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libaio                    0.9.0                    pypi_0    pypi
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgomp                   11.2.0              h1d223b6_11    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
openssl                   3.0.0                h7f98852_1    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
python                    3.9.7           hf930737_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                58.3.0           py39hf3d152e_0    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
vpelletier commented 3 years ago

Thanks for the heads-up and sorry for the breakage (...of a test I just added for this release... shame).

This is an off-by-one in error recovery codepath, and right before pushing I thought of a way to simplify the code a tiny bit - and of course broke it in the process.

I have now released 0.9.1 which should pass all tests.

hmaarrfk commented 3 years ago

Thank you. Glad i could help.