question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.1.3: pytest is failing

See original GitHub issue

I’m trying to package your module as an rpm package. So I’m using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I’m calling build with --no-isolation I’m using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-mpi4py-3.1.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-mpi4py-3.1.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/mpi4py-3.1.3, configfile: setup.cfg, testpaths: test
collected 1402 items

test/test_address.py .....                                                                                                                                           [  0%]
test/test_attributes.py ........................................ssssssss                                                                                             [  3%]
test/test_cco_buf.py ........................................................................                                                                        [  8%]
test/test_cco_nb_buf.py ......................................................................                                                                       [ 13%]
test/test_cco_nb_vec.py ..........................................................                                                                                   [ 18%]
test/test_cco_ngh_buf.py ................                                                                                                                            [ 19%]
test/test_cco_ngh_obj.py ........                                                                                                                                    [ 19%]
test/test_cco_obj.py ........................................                                                                                                        [ 22%]
test/test_cco_obj_inter.py ssssssssssssssssssssssss                                                                                                                  [ 24%]
test/test_cco_vec.py ..............................................................                                                                                  [ 28%]
test/test_cffi.py ss                                                                                                                                                 [ 28%]
test/test_comm.py ...................................................................                                                                                [ 33%]
test/test_comm_inter.py ssssssssssss                                                                                                                                 [ 34%]
test/test_comm_topo.py ............................                                                                                                                  [ 36%]
test/test_ctypes.py ..                                                                                                                                               [ 36%]
test/test_datatype.py .........................                                                                                                                      [ 38%]
test/test_dl.py ....                                                                                                                                                 [ 38%]
test/test_doc.py .                                                                                                                                                   [ 38%]
test/test_dynproc.py sss.                                                                                                                                            [ 39%]
test/test_environ.py ..............                                                                                                                                  [ 40%]
test/test_errhandler.py .....s                                                                                                                                       [ 40%]
test/test_errorcode.py .....                                                                                                                                         [ 40%]
test/test_exceptions.py ....................................sssss...                                                                                                 [ 44%]
test/test_file.py ..............                                                                                                                                     [ 45%]
test/test_fortran.py ...........                                                                                                                                     [ 45%]
test/test_grequest.py ...                                                                                                                                            [ 46%]
test/test_group.py ................................................                                                                                                  [ 49%]
test/test_info.py ..........                                                                                                                                         [ 50%]
test/test_io.py ............................                                                                                                                         [ 52%]
test/test_memory.py .............                                                                                                                                    [ 53%]
test/test_mpimem.py ..                                                                                                                                               [ 53%]
test/test_msgspec.py ..s....ss............FF.........ssssss......ssssssssssssssssss......................................................ssssssssssss......s.s...... [ 63%]
s..ss                                                                                                                                                                [ 63%]
test/test_msgzero.py ...s...s                                                                                                                                        [ 64%]
test/test_objmodel.py .........                                                                                                                                      [ 64%]
test/test_op.py .........                                                                                                                                            [ 65%]
test/test_p2p_buf.py ....................................                                                                                                            [ 68%]
test/test_p2p_buf_matched.py ..........                                                                                                                              [ 68%]
test/test_p2p_obj.py ................................................................................                                                                [ 74%]
test/test_p2p_obj_matched.py ..........                                                                                                                              [ 75%]
test/test_pack.py ......                                                                                                                                             [ 75%]
test/test_pickle.py ..s...s                                                                                                                                          [ 76%]
test/test_rc.py ...                                                                                                                                                  [ 76%]
test/test_request.py .........                                                                                                                                       [ 77%]
test/test_rma.py ssssssssssssssssssssssssssssssssssss                                                                                                                [ 79%]
test/test_rma_nb.py ssssssssssssss                                                                                                                                   [ 80%]
test/test_spawn.py ssssssssssssssssssssssssssssssssssssssss                                                                                                          [ 83%]
test/test_status.py .........                                                                                                                                        [ 84%]
test/test_subclass.py ..............................ss..                                                                                                             [ 86%]
test/test_threads.py ...                                                                                                                                             [ 86%]
test/test_util_dtlib.py ...................                                                                                                                          [ 88%]
test/test_util_pkl5.py ..........................................................................................                                                    [ 94%]
test/test_win.py ssssssssssssssssss......................................ssssssssssssssssssss                                                                        [100%]

================================================================================= FAILURES =================================================================================
_________________________________________________________________ TestMessageSimpleNumPy.testNotContiguous _________________________________________________________________

>   ???
E   ValueError: ndarray is not contiguous

mpi4py/MPI/asbuffer.pxi:140: ValueError

During handling of the above exception, another exception occurred:

self = <test_msgspec.TestMessageSimpleNumPy testMethod=testNotContiguous>

    def testNotContiguous(self):
        sbuf = numpy.ones([3,2])[:,0]
        rbuf = numpy.zeros([3])
        sbuf.flags.writeable = False
>       self.assertRaises((BufferError, ValueError),
                          Sendrecv, sbuf, rbuf)

test/test_msgspec.py:457:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_msgspec.py:158: in Sendrecv
    MPI.COMM_SELF.Sendrecv(sendbuf=smsg, dest=0,   sendtag=0,
mpi4py/MPI/Comm.pyx:327: in mpi4py.MPI.Comm.Sendrecv
    ???
mpi4py/MPI/msgbuffer.pxi:455: in mpi4py.MPI.message_p2p_send
    ???
mpi4py/MPI/msgbuffer.pxi:438: in mpi4py.MPI._p_msg_p2p.for_send
    ???
mpi4py/MPI/msgbuffer.pxi:203: in mpi4py.MPI.message_simple
    ???
mpi4py/MPI/msgbuffer.pxi:138: in mpi4py.MPI.message_basic
    ???
mpi4py/MPI/asbuffer.pxi:365: in mpi4py.MPI.getbuffer
    ???
mpi4py/MPI/asbuffer.pxi:144: in mpi4py.MPI.PyMPI_GetBuffer
    ???
mpi4py/MPI/commimpl.pxi:142: in mpi4py.MPI.PyMPI_Lock
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   TypeError: NumPy currently only supports dlpack for writeable arrays

mpi4py/MPI/asdlpack.pxi:193: TypeError
_________________________________________________________________ TestMessageSimpleNumPy.testNotWriteable __________________________________________________________________

>   ???
E   ValueError: buffer source array is read-only

mpi4py/MPI/asbuffer.pxi:140: ValueError

During handling of the above exception, another exception occurred:

self = <test_msgspec.TestMessageSimpleNumPy testMethod=testNotWriteable>

    def testNotWriteable(self):
        sbuf = numpy.ones([3])
        rbuf = numpy.zeros([3])
        rbuf.flags.writeable = False
>       self.assertRaises((BufferError, ValueError),
                          Sendrecv, sbuf, rbuf)

test/test_msgspec.py:450:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_msgspec.py:158: in Sendrecv
    MPI.COMM_SELF.Sendrecv(sendbuf=smsg, dest=0,   sendtag=0,
mpi4py/MPI/Comm.pyx:328: in mpi4py.MPI.Comm.Sendrecv
    ???
mpi4py/MPI/msgbuffer.pxi:460: in mpi4py.MPI.message_p2p_recv
    ???
mpi4py/MPI/msgbuffer.pxi:446: in mpi4py.MPI._p_msg_p2p.for_recv
    ???
mpi4py/MPI/msgbuffer.pxi:203: in mpi4py.MPI.message_simple
    ???
mpi4py/MPI/msgbuffer.pxi:138: in mpi4py.MPI.message_basic
    ???
mpi4py/MPI/asbuffer.pxi:365: in mpi4py.MPI.getbuffer
    ???
mpi4py/MPI/asbuffer.pxi:144: in mpi4py.MPI.PyMPI_GetBuffer
    ???
mpi4py/MPI/commimpl.pxi:142: in mpi4py.MPI.PyMPI_Lock
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   TypeError: NumPy currently only supports dlpack for writeable arrays

mpi4py/MPI/asdlpack.pxi:193: TypeError
========================================================================= short test summary info ==========================================================================
SKIPPED [1] test/test_attributes.py:20: mpi-win-attr
SKIPPED [1] test/test_attributes.py:190: mpi-win-attr
SKIPPED [1] test/test_attributes.py:42: mpi-win-attr
SKIPPED [1] test/test_attributes.py:45: mpi-win-attr
SKIPPED [1] test/test_attributes.py:48: mpi-win-attr
SKIPPED [1] test/test_attributes.py:71: mpi-win-attr
SKIPPED [1] test/test_attributes.py:100: mpi-win-attr
SKIPPED [1] test/test_attributes.py:96: mpi-win-attr
SKIPPED [3] test/test_cco_obj_inter.py:115: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:158: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:124: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:55: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:59: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:77: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:132: mpi-world-size<2
SKIPPED [3] test/test_cco_obj_inter.py:96: mpi-world-size<2
SKIPPED [1] test/test_cffi.py:49: cffi
SKIPPED [1] test/test_cffi.py:70: cffi
SKIPPED [3] test/test_comm_inter.py:34: mpi-world-size<2
SKIPPED [3] test/test_comm_inter.py:41: mpi-world-size<2
SKIPPED [3] test/test_comm_inter.py:57: mpi-world-size<2
SKIPPED [3] test/test_comm_inter.py:50: mpi-world-size<2
SKIPPED [1] test/test_dynproc.py:63: mpi-world-size<2
SKIPPED [1] test/test_dynproc.py:112: mpi-world-size<2
SKIPPED [1] test/test_dynproc.py:161: mpi-world-size<2
SKIPPED [1] test/test_errhandler.py:45: mpi-win
SKIPPED [1] test/test_exceptions.py:314: mpi-win
SKIPPED [1] test/test_exceptions.py:301: mpi-win
SKIPPED [1] test/test_exceptions.py:305: mpi-win
SKIPPED [1] test/test_exceptions.py:309: mpi-win
SKIPPED [1] test/test_exceptions.py:331: mpi-win
SKIPPED [1] test/test_msgspec.py:239: python3
SKIPPED [1] test/test_msgspec.py:231: python3
SKIPPED [1] test/test_msgspec.py:263: mpi-world-size<2
SKIPPED [2] test/test_msgspec.py:393: cupy
SKIPPED [2] test/test_msgspec.py:396: cupy
SKIPPED [2] test/test_msgspec.py:399: cupy
SKIPPED [2] test/test_msgspec.py:402: cupy
SKIPPED [2] test/test_msgspec.py:405: cupy
SKIPPED [2] test/test_msgspec.py:408: cupy
SKIPPED [1] test/test_msgspec.py:506: cupy
SKIPPED [1] test/test_msgspec.py:493: cupy
SKIPPED [1] test/test_msgspec.py:499: cupy
SKIPPED [1] test/test_msgspec.py:393: numba
SKIPPED [1] test/test_msgspec.py:396: numba
SKIPPED [1] test/test_msgspec.py:399: numba
SKIPPED [1] test/test_msgspec.py:402: numba
SKIPPED [1] test/test_msgspec.py:405: numba
SKIPPED [1] test/test_msgspec.py:408: numba
SKIPPED [1] test/test_msgspec.py:550: numba
SKIPPED [1] test/test_msgspec.py:524: numba
SKIPPED [1] test/test_msgspec.py:537: numba
SKIPPED [1] test/test_msgspec.py:1040: cupy
SKIPPED [1] test/test_msgspec.py:1043: cupy
SKIPPED [1] test/test_msgspec.py:1046: cupy
SKIPPED [1] test/test_msgspec.py:1049: cupy
SKIPPED [1] test/test_msgspec.py:1052: cupy
SKIPPED [1] test/test_msgspec.py:1055: cupy
SKIPPED [1] test/test_msgspec.py:1040: numba
SKIPPED [1] test/test_msgspec.py:1043: numba
SKIPPED [1] test/test_msgspec.py:1046: numba
SKIPPED [1] test/test_msgspec.py:1049: numba
SKIPPED [1] test/test_msgspec.py:1052: numba
SKIPPED [1] test/test_msgspec.py:1055: numba
SKIPPED [1] test/test_msgspec.py:1199: cupy
SKIPPED [1] test/test_msgspec.py:1208: numba
SKIPPED [1] test/test_msgspec.py:1332: cupy
SKIPPED [1] test/test_msgspec.py:1341: numba
SKIPPED [1] test/test_msgspec.py:1300: python3
SKIPPED [2] test/test_msgzero.py:33: openmpi
SKIPPED [1] test/test_pickle.py:126: dill
SKIPPED [1] test/test_pickle.py:168: yaml
SKIPPED [2] test/test_rma.py:91: mpi-rma
SKIPPED [2] test/test_rma.py:261: mpi-rma
SKIPPED [2] test/test_rma.py:270: mpi-rma
SKIPPED [2] test/test_rma.py:207: mpi-rma
SKIPPED [2] test/test_rma.py:307: mpi-rma
SKIPPED [2] test/test_rma.py:319: mpi-rma
SKIPPED [2] test/test_rma.py:163: mpi-rma
SKIPPED [2] test/test_rma.py:407: mpi-rma
SKIPPED [2] test/test_rma.py:114: mpi-rma
SKIPPED [2] test/test_rma.py:279: mpi-rma
SKIPPED [2] test/test_rma.py:256: mpi-rma
SKIPPED [2] test/test_rma.py:340: mpi-rma
SKIPPED [2] test/test_rma.py:42: mpi-rma
SKIPPED [2] test/test_rma.py:251: mpi-rma
SKIPPED [2] test/test_rma.py:335: mpi-rma
SKIPPED [2] test/test_rma.py:369: mpi-rma
SKIPPED [2] test/test_rma.py:345: mpi-rma
SKIPPED [2] test/test_rma.py:397: mpi-rma
SKIPPED [2] test/test_rma_nb.py:67: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:151: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:161: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:100: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:144: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:44: mpi-rma-nb
SKIPPED [2] test/test_rma_nb.py:137: mpi-rma-nb
SKIPPED [4] test/test_spawn.py:120: using CUDA
SKIPPED [4] test/test_spawn.py:219: using CUDA
SKIPPED [4] test/test_spawn.py:94: using CUDA
SKIPPED [4] test/test_spawn.py:151: using CUDA
SKIPPED [4] test/test_spawn.py:169: using CUDA
SKIPPED [4] test/test_spawn.py:183: using CUDA
SKIPPED [4] test/test_spawn.py:106: using CUDA
SKIPPED [4] test/test_spawn.py:197: using CUDA
SKIPPED [4] test/test_spawn.py:134: using CUDA
SKIPPED [4] test/test_spawn.py:239: using CUDA
SKIPPED [1] test/test_subclass.py:234: mpi-win
SKIPPED [1] test/test_subclass.py:229: mpi-win
SKIPPED [2] test/test_win.py:47: mpi-win-create
SKIPPED [2] test/test_win.py:95: mpi-win-create
SKIPPED [2] test/test_win.py:30: mpi-win-create
SKIPPED [2] test/test_win.py:53: mpi-win-create
SKIPPED [2] test/test_win.py:71: mpi-win-create
SKIPPED [2] test/test_win.py:61: mpi-win-create
SKIPPED [2] test/test_win.py:85: mpi-win-create
SKIPPED [2] test/test_win.py:38: mpi-win-create
SKIPPED [2] test/test_win.py:106: mpi-win-create
SKIPPED [2] test/test_win.py:194: mpi-win-dynamic
SKIPPED [2] test/test_win.py:189: mpi-win-dynamic
SKIPPED [2] test/test_win.py:95: mpi-win-dynamic
SKIPPED [2] test/test_win.py:176: mpi-win-dynamic
SKIPPED [2] test/test_win.py:53: mpi-win-dynamic
SKIPPED [2] test/test_win.py:71: mpi-win-dynamic
SKIPPED [2] test/test_win.py:61: mpi-win-dynamic
SKIPPED [2] test/test_win.py:85: mpi-win-dynamic
SKIPPED [2] test/test_win.py:182: mpi-win-dynamic
SKIPPED [2] test/test_win.py:106: mpi-win-dynamic
FAILED test/test_msgspec.py::TestMessageSimpleNumPy::testNotContiguous - TypeError: NumPy currently only supports dlpack for writeable arrays
FAILED test/test_msgspec.py::TestMessageSimpleNumPy::testNotWriteable - TypeError: NumPy currently only supports dlpack for writeable arrays
=============================================================== 2 failed, 1167 passed, 233 skipped in 24.75s ===============================================================

In my build procedure I’ve added temporary those failing units to to --deselect list.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dalcinlcommented, Jun 12, 2022

do you have ETA of next release?

Not yet. There are a few things I still have to work on. In any case, next mpi4py release will not happen before Open MPI releases v5.0. I’m waiting for them to fix many issues related to MPI-4 support.

0reactions
dalcinlcommented, Jun 23, 2022

@kloczek Please look at fbe56aa, you may need pieces of that patch for NumPy 1.23.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytest --sw doesn't remember failures when using subtests ...
When I run pytest --sw the first time, it runs both tests (as expected). As a sidenote, though, it does seem to miscount...
Read more >
Changelog — pytest documentation
After 6.2.0, these types began failing, because they inherited neither from standard Python number hierarchy nor from numpy.ndarray .
Read more >
pytest Documentation
The first test passed and the second failed. You can easily see the intermediate values in the assertion to help you under-.
Read more >
pytest API Manual - Hubwiz.com
April 2015 is “adopt pytest month” · Release announcements · py.test 2.0.0: asserts++, unittest++, ... Behavior when no tests failed in the last...
Read more >
pytest-docker-tools
Docker integration tests for pytest. ... pytest-docker-tools 3.1.3 ... If the test fails the docker logs output from each container will be captured...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found