Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parallel execution of directional plugin test ("Different tests were collected between gw0 and gw1") #111

Merged
merged 1 commit into from Apr 27, 2020

Conversation

leroyvn
Copy link
Contributor

@leroyvn leroyvn commented Apr 27, 2020

This MR fixes a bug where the directional plugin test collection would fail when running pytest in parallel mode.

@Speierers
Copy link
Member

I would be interested in understanding how this solves your issue?

But happy to merge this of course ;)

@Speierers Speierers merged commit 2a2f1b1 into mitsuba-renderer:master Apr 27, 2020
@leroyvn
Copy link
Contributor Author

leroyvn commented Apr 27, 2020

Indeed, sorry for not being more chatty about that! Parallel test collection was often failing because the xml_spectrum_keys list order would change between the different pytest threads. I'd get the following kind of error message:

🅒 mitsuba2 in mitsuba2 ➜ pytest -n 4 src/emitters/tests/test_directional.py
Running the full test suite. To skip slow tests, please run 'pytest -m 'not slow'
================================ test session starts ================================
platform darwin -- Python 3.7.7, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /Users/vincent/Documents/src/thirdparty/mitsuba2, inifile: setup.cfg
plugins: xdist-1.30.0, forked-1.1.3
gw0 [18] / gw1 [18] / gw2 [18] / gw3 [18]
collecting 0 items / 1 error
====================================== ERRORS =======================================
_______________________________ ERROR collecting gw1 ________________________________
Different tests were collected between gw0 and gw1. The difference is:
--- gw0

+++ gw1

@@ -1,12 +1,12 @@

 src/emitters/tests/test_directional.py::test_construct
+src/emitters/tests/test_directional.py::test_eval[regular]
 src/emitters/tests/test_directional.py::test_eval[d65]
-src/emitters/tests/test_directional.py::test_eval[regular]
+src/emitters/tests/test_directional.py::test_sample_direction[direction0-regular]
 src/emitters/tests/test_directional.py::test_sample_direction[direction0-d65]
-src/emitters/tests/test_directional.py::test_sample_direction[direction0-regular]
+src/emitters/tests/test_directional.py::test_sample_direction[direction1-regular]
 src/emitters/tests/test_directional.py::test_sample_direction[direction1-d65]
-src/emitters/tests/test_directional.py::test_sample_direction[direction1-regular]
+src/emitters/tests/test_directional.py::test_sample_direction[direction2-regular]
 src/emitters/tests/test_directional.py::test_sample_direction[direction2-d65]
-src/emitters/tests/test_directional.py::test_sample_direction[direction2-regular]
 src/emitters/tests/test_directional.py::test_sample_ray[direction0-spatial_sample0]
 src/emitters/tests/test_directional.py::test_sample_ray[direction0-spatial_sample1]
 src/emitters/tests/test_directional.py::test_sample_ray[direction0-spatial_sample2]
============================== short test summary info ==============================
ERROR gw1
================================= 1 error in 0.71s ==================================

This kind of issue was mentioned here on the pytest-xdist repo.

@leroyvn leroyvn changed the title Fix parallel execution of directional plugin test Fix parallel execution of directional plugin test ("Different tests were collected between gw0 and gw1") Apr 27, 2020
@leroyvn leroyvn deleted the fix-test_directional branch April 27, 2020 16:14
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.

None yet

2 participants