Skip to content

Conversation

lgarrison
Copy link
Contributor

While running pytest on dask_mpi, I encountered the below fixture 'loop_in_thread' not found error. A quick search brought up dask/dask#9337, where they encountered the same error and fixed it with the extra imports that are in this PR. I think this is a workaround rather than a long-term fix, but it will unstick the CI while the issue is addressed upstream.

(venv8) lgarrison@scclin021:~/scc/repo/dask-mpi$ pytest -xv dask_mpi/
================================================= test session starts ==================================================
platform linux -- Python 3.8.12, pytest-7.1.3, pluggy-1.0.0 -- /mnt/home/lgarrison/scc/daskdistrib/venv8/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/mnt/home/lgarrison/scc/repo/dask-mpi/.hypothesis/examples')
rootdir: /mnt/home/lgarrison/scc/repo/dask-mpi, configfile: setup.cfg
plugins: anyio-3.5.0, hypothesis-6.23.1
collected 12 items                                                                                                     

dask_mpi/tests/test_cli.py::test_basic[distributed.Worker] ERROR                                                 [  8%]

======================================================== ERRORS ========================================================
___________________________________ ERROR at setup of test_basic[distributed.Worker] ___________________________________
file /mnt/home/lgarrison/scc/repo/dask-mpi/dask_mpi/tests/test_cli.py, line 23
  @pytest.mark.parametrize(
      "worker_class",
      ["distributed.Worker", "distributed.Nanny", "dask_cuda.CUDAWorker"],
  )
  def test_basic(loop, worker_class, mpirun):
file /mnt/home/lgarrison/scc/daskdistrib/venv8/lib/python3.8/site-packages/distributed/utils_test.py, line 126
  @pytest.fixture
  def loop(loop_in_thread):
E       fixture 'loop_in_thread' not found
>       available fixtures: allow_run_as_root, anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, loop, monkeypatch, mpirun, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/mnt/home/lgarrison/scc/daskdistrib/venv8/lib/python3.8/site-packages/distributed/utils_test.py:126
=================================================== warnings summary ===================================================
dask_mpi/tests/test_cli.py:14
  /mnt/home/lgarrison/scc/repo/dask-mpi/dask_mpi/tests/test_cli.py:14: FutureWarning: tmpfile is deprecated and will be removed in a future release. Please use dask.utils.tmpfile instead.
    from distributed.utils import import_term, tmpfile

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================= slowest 10 durations =================================================
0.00s setup    dask_mpi/tests/test_cli.py::test_basic[distributed.Worker]
0.00s teardown dask_mpi/tests/test_cli.py::test_basic[distributed.Worker]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 warning, 1 error in 0.59s ==============================================

@lgarrison
Copy link
Contributor Author

Not sure I understand the pre-commi.ci failure, it looks like it found issues, then fixed them, right? Do I need to do something else for it to pass the check?

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for this.

It looks like black and isort are fighting, one is modifying the files and the other is reverting which is why the automated commit didn't fix the failure.

I've pushed some extra config to get them to play nice.

@jacobtomlinson jacobtomlinson merged commit 9dbb9b7 into dask:main Oct 7, 2022
@lgarrison lgarrison deleted the fix-tests branch October 7, 2022 15:32
@kmpaul
Copy link
Collaborator

kmpaul commented Oct 8, 2022

Thanks, Jacob!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants