Repository navigation
Parallel testing on Python >= 3.3 breaks due to pseudo-nondeterministic test collection #2871
Copy link
Copy link
Closed
Labels
Description
I will post the full output below, but the relevant portion is this:
INTERNALERROR> AssertionError: Different tests were collected between gw5 and gw3. The difference is:
INTERNALERROR> --- gw5
INTERNALERROR>
INTERNALERROR> +++ gw3
INTERNALERROR>
INTERNALERROR> @@ -2693,7 +2693,7 @@
INTERNALERROR>
INTERNALERROR> astropy/table/np_utils.py::astropy.table.np_utils.vstack
INTERNALERROR> astropy/table/operations.py::astropy.table.operations.hstack
INTERNALERROR> astropy/table/operations.py::astropy.table.operations.vstack
INTERNALERROR> -astropy/table/table.py::astropy.table.table.Row
INTERNALERROR> +astropy/table/table.py::astropy.table.table.Table.Row
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_column
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_columns
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_row
I think that what's happening here is that astropy/table/table.py::astropy.table.table.Row and astropy/table/table.py::astropy.table.table.Table.Row both refer to the same object. But for some reason one test runner is finding the latter before the former. I'm going ahead and marking this "upstream fix required" because the test collector should be able to recognize those as the same object, though I'm not sure about the details.
This might also not be just on Python 3.4, but that was the only Python version where I could reproduce the issue. It's probably something pseudo-nondeterminisitic.
====================================================== test session starts =======================================================
platform linux -- Python 3.4.0 -- pytest-2.5.1
Running tests with Astropy version 1.0.dev9659.
Running tests in /tmp/astropy-test-moymwonq/lib.linux-x86_64-3.4/astropy /internal/1/root/src/astropy/astropy/docs.
Platform: Linux-2.6.32-431.20.3.el6.x86_64-x86_64-with-redhat-6.5-Santiago
Executable: /internal/1/root/bin/overrides/python3.4
Full Python Version:
3.4.0 (default, Apr 29 2014, 16:13:55)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.9.0.dev-7f46687
Scipy: 0.13.3
Matplotlib: not available
h5py: not available
Running doctests in .rst files is not supported on Python 3.x
plugins: xdist, cov
gw0 [5386] / gw1 [5386] / gw2 [5386] / gw3 [5386] / gw4 [5386] / gw5 [5386]
scheduling tests via LoadScheduling
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "_pytest.main", line 81, in wrap_session
INTERNALERROR> doit(config, session)
INTERNALERROR> File "_pytest.main", line 117, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "_pytest.core", line 376, in __call__
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "_pytest.core", line 387, in _docall
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "_pytest.core", line 288, in execute
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/xdist/dsession.py", line 244, in pytest_runtestloop
INTERNALERROR> self.loop_once()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/xdist/dsession.py", line 262, in loop_once
INTERNALERROR> call(**kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/xdist/dsession.py", line 315, in slave_collectionfinish
INTERNALERROR> self.sched.init_distribute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/xdist/dsession.py", line 138, in init_distribute
INTERNALERROR> node.gateway.id,
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/xdist/dsession.py", line 188, in report_collection_diff
INTERNALERROR> raise AssertionError(msg)
INTERNALERROR> AssertionError: Different tests were collected between gw5 and gw3. The difference is:
INTERNALERROR> --- gw5
INTERNALERROR>
INTERNALERROR> +++ gw3
INTERNALERROR>
INTERNALERROR> @@ -2693,7 +2693,7 @@
INTERNALERROR>
INTERNALERROR> astropy/table/np_utils.py::astropy.table.np_utils.vstack
INTERNALERROR> astropy/table/operations.py::astropy.table.operations.hstack
INTERNALERROR> astropy/table/operations.py::astropy.table.operations.vstack
INTERNALERROR> -astropy/table/table.py::astropy.table.table.Row
INTERNALERROR> +astropy/table/table.py::astropy.table.table.Table.Row
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_column
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_columns
INTERNALERROR> astropy/table/table.py::astropy.table.table.Table.add_row
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> doit(config, session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> doit(config, session)
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> EOFError
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> doit(config, session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> EOFError
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> doit(config, session)
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> EOFError
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> EOFError
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> doit(config, session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> EOFError
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 81, in wrap_session
INTERNALERROR> doit(config, session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/main.py", line 118, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 377, in __call__
INTERNALERROR> return self._docall(methods, kwargs)
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 388, in _docall
INTERNALERROR> res = mc.execute()
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/_pytest/core.py", line 289, in execute
INTERNALERROR> res = method(**kwargs)
INTERNALERROR> File "<remote exec>", line 47, in pytest_runtestloop
INTERNALERROR> File "/internal/1/root/usr/local/lib/python3.4/site-packages/execnet/gateway_base.py", line 701, in receive
INTERNALERROR> raise self._getremoteerror() or EOFError()
INTERNALERROR> EOFError
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/astropy-test-moymwonq/lib.linux-x86_64-3.4/astropy/extern/bundled/six.py' mode='r' encoding='utf-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/astropy-test-moymwonq/lib.linux-x86_64-3.4/astropy/extern/bundled/six.py' mode='r' encoding='utf-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/astropy-test-moymwonq/lib.linux-x86_64-3.4/astropy/extern/bundled/six.py' mode='r' encoding='utf-8'>
Reactions are currently unavailable
Activity
embray commentedon Aug 19, 2014
Probably related: https://bitbucket.org/hpk42/pytest/issue/545/_pytest-markpy
embray commentedon Aug 19, 2014
Also related: https://bitbucket.org/hpk42/pytest/issue/437/different-tests-collected-on-two-nodes
embray commentedon Aug 19, 2014
A possible workaround might be to move the
Rowclass to its own submodule. Looking at the code it seems like it shouldn't be a hard move to make, and it can't hurt to break up long modules a little where possible. At the same time, I don't know if it's worth it so I'm not going to make that call right now.taldcroft commentedon Aug 19, 2014
Rowis moved in #2872.embray commentedon Aug 19, 2014
#2872 seems to make progress, but then the same problem in pytest rears its ugly head here:
Seems to be the same sort of problem :( I'm not sure there's much can be done there except wait for a fix in pytest. In the meantime #2872 is not a bad idea in its own right.
embray commentedon Aug 20, 2014
Reopening but changing the name to not specifically implicate Table.Row
[-]Table.Row breaks parallel testing on Python 3.4[/-][+]Parallel testing on Python >= 3.3 breaks due to pseudo-nondeterministic test collection[/+]astrofrog commentedon Aug 2, 2017
The latest issues appear to be due to a bug in pytest-xdist: pytest-dev/pytest-xdist#198
astrofrog commentedon Aug 2, 2017
@drdavella - changing the astropy coordinates fixtures to function level fixes things by the way, so I'll open a quick PR for that
astrofrog commentedon Aug 3, 2017
This is now all fixed and we are running the tests with
--parallelon CircleCI to prevent regressions