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

test_dcm2niix_dwi failing intermittently #3046

Open
effigies opened this issue Sep 23, 2019 · 6 comments · Fixed by #3058
Open

test_dcm2niix_dwi failing intermittently #3046

effigies opened this issue Sep 23, 2019 · 6 comments · Fixed by #3058

Comments

@effigies
Copy link
Member

Summary

Merged #3038 and released 1.2.3 this morning, and new errors have popped up.

[gw0] [ 96%] PASSED utils/tests/test_misc.py::test_rgetcwd INTERNALERROR> Traceback (most recent call last):

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/main.py", line 191, in wrap_session

INTERNALERROR>     session.exitstatus = doit(config, session) or 0

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/main.py", line 235, in _main

INTERNALERROR>     config.hook.pytest_runtestloop(session=session)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/hooks.py", line 286, in __call__

INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 92, in _hookexec

INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 86, in <lambda>

INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 208, in _multicall

INTERNALERROR>     return outcome.get_result()

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result

INTERNALERROR>     raise ex[1].with_traceback(ex[2])

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 187, in _multicall

INTERNALERROR>     res = hook_impl.function(*args)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/xdist/remote.py", line 68, in pytest_runtestloop

INTERNALERROR>     self.run_one_test(torun)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/xdist/remote.py", line 85, in run_one_test

INTERNALERROR>     self.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/hooks.py", line 286, in __call__

INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 92, in _hookexec

INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 86, in <lambda>

INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 208, in _multicall

INTERNALERROR>     return outcome.get_result()

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result

INTERNALERROR>     raise ex[1].with_traceback(ex[2])

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 182, in _multicall

INTERNALERROR>     next(gen)  # first yield

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/warnings.py", line 112, in pytest_runtest_protocol

INTERNALERROR>     config=item.config, ihook=item.ihook, when="runtest", item=item

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/nodes.py", line 100, in ihook

INTERNALERROR>     return self.session.gethookproxy(self.fspath)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/main.py", line 424, in gethookproxy

INTERNALERROR>     my_conftestmodules = pm._getconftestmodules(fspath)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/config/__init__.py", line 417, in _getconftestmodules

INTERNALERROR>     mod = self._importconftest(conftestpath)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/config/__init__.py", line 437, in _importconftest

INTERNALERROR>     key = Path(str(conftestpath)).resolve()

INTERNALERROR>   File "/home/travis/build/nipy/nipype/nipype/utils/filemanip.py", line 67, in _patch_resolve

INTERNALERROR>     resolved = Path().old_resolve() / self

INTERNALERROR>   File "/opt/python/3.5.6/lib/python3.5/pathlib.py", line 1109, in resolve

INTERNALERROR>     s = self._flavour.resolve(self)

INTERNALERROR>   File "/opt/python/3.5.6/lib/python3.5/pathlib.py", line 329, in resolve

INTERNALERROR>     base = '' if path.is_absolute() else os.getcwd()

INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory

[gw1] [ 96%] PASSED pipeline/engine/tests/test_workflows.py::test_outputs_removal_wf[MultiProc-True-False] 

pipeline/engine/tests/test_workflows.py::test_config_setting 

[gw1] [ 96%] PASSED pipeline/engine/tests/test_workflows.py::test_config_setting 

pipeline/plugins/sge.py::nipype.pipeline.plugins.sge.qsub_sanitize_job_name 

[gw1] [ 96%] PASSED pipeline/plugins/sge.py::nipype.pipeline.plugins.sge.qsub_sanitize_job_name 

pipeline/plugins/tests/test_base.py::test_scipy_sparse 

[gw1] [ 96%] PASSED pipeline/plugins/tests/test_base.py::test_scipy_sparse 

pipeline/plugins/tests/test_callback.py::test_callback_normal[Linear] 

[gw1] [ 97%] PASSED pipeline/plugins/tests/test_callback.py::test_callback_normal[Linear] 

pipeline/plugins/tests/test_callback.py::test_callback_normal[MultiProc] 190923-15:20:56,313 nipype.utils INFO:

	 Running nipype version 1.2.3 (latest: 1.2.2)

INTERNALERROR> Traceback (most recent call last):

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/main.py", line 191, in wrap_session

INTERNALERROR>     session.exitstatus = doit(config, session) or 0

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/_pytest/main.py", line 235, in _main

INTERNALERROR>     config.hook.pytest_runtestloop(session=session)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/hooks.py", line 286, in __call__

INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 92, in _hookexec

INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/manager.py", line 86, in <lambda>

INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 203, in _multicall

INTERNALERROR>     gen.send(outcome)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result

INTERNALERROR>     raise ex[1].with_traceback(ex[2])

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/pluggy/callers.py", line 187, in _multicall

INTERNALERROR>     res = hook_impl.function(*args)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/xdist/dsession.py", line 115, in pytest_runtestloop

INTERNALERROR>     self.loop_once()

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/xdist/dsession.py", line 138, in loop_once

INTERNALERROR>     call(**kwargs)

INTERNALERROR>   File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/xdist/dsession.py", line 180, in worker_workerfinished

INTERNALERROR>     assert not crashitem, (crashitem, node)

INTERNALERROR> AssertionError: ('utils/tests/test_nipype2boutiques.py::test_generate', <WorkerController gw0>)

INTERNALERROR> assert not 'utils/tests/test_nipype2boutiques.py::test_generate'

This seems likely to be related to the Pytest 5.1.3 release this weekend.

Additionally, the newly active dcm2niix tests from #2936 seem to be failing on CircleCI, but only for the tag build, not the master build:

assert <undefined>  +  where <undefined> = \nbids = <undefined>\nbvals = <undefined>\nbvecs = <undefined>\nconverted_files = <undefined>\n.converted_files  +    where \nbids = <undefined>\nbvals = <undefined>\nbvecs = <undefined>\nconverted_files = <undefined>\n = <nipype.interfaces.base.support.InterfaceResult object at 0x7fa215e7b588>.outputs
tmpdir = local('/tmp/pytest-of-neuro/pytest-0/popen-gw1/test_dcm2niix_dwi0')

    @pytest.mark.skipif(no_datalad, reason="Datalad required")
    @pytest.mark.skipif(no_dcm2niix, reason="Dcm2niix required")
    def test_dcm2niix_dwi(tmpdir):
        tmpdir.chdir()
        try:
            datadir = fetch_data(tmpdir.strpath, 'Siemens_Sag_DTI_20160825_145811')
        except IncompleteResultsError as exc:
            pytest.skip("Failed to fetch test data: %s" % str(exc))
    
        def assert_dwi(eg, bids):
            "Some assertions we will make"
            assert eg.outputs.converted_files
            assert eg.outputs.bvals
            assert eg.outputs.bvecs
            outputs = [y for x,y in eg.outputs.get().items()]
            if bids:
                # ensure all outputs are of equal lengths
                assert len(set(map(len, outputs))) == 1
            else:
                assert not eg.outputs.bids
    
        dcm = Dcm2niix()
        dcm.inputs.source_dir = datadir
        dcm.inputs.out_filename = '%u%z'
>       assert_dwi(dcm.run(), True)

/src/nipype/nipype/interfaces/tests/test_extra_dcm2nii.py:49: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

eg = <nipype.interfaces.base.support.InterfaceResult object at 0x7fa215e7b588>
bids = True

    def assert_dwi(eg, bids):
        "Some assertions we will make"
>       assert eg.outputs.converted_files
E       assert <undefined>
E        +  where <undefined> = \nbids = <undefined>\nbvals = <undefined>\nbvecs = <undefined>\nconverted_files = <undefined>\n.converted_files
E        +    where \nbids = <undefined>\nbvals = <undefined>\nbvecs = <undefined>\nconverted_files = <undefined>\n = <nipype.interfaces.base.support.InterfaceResult object at 0x7fa215e7b588>.outputs

/src/nipype/nipype/interfaces/tests/test_extra_dcm2nii.py:36: AssertionError

The reason for this is unclear. In both cases we appear to be building the docker image from scratch, so they should be ostensibly equivalent environments.

I'll plan on building the packages and pushing to PyPI for the sake of the archive (probably tonight), but we should probably figure out what's going on and try to do a quick 1.2.4 fixup release.

@effigies
Copy link
Member Author

@mgxd The dcm2niix test is not resolved by using an old pytest. It's unclear to me why this test is now failing.

@satra
Copy link
Member

satra commented Sep 30, 2019

this test also fails in circle on 2.7

@effigies
Copy link
Member Author

I'm unclear on why it is now working again for Python 3.

@effigies effigies changed the title New test failures test_dcm2niix_dwi failing intermittently Sep 30, 2019
@effigies
Copy link
Member Author

Updated the title to reflect current state.

@mgxd Do you have any time to look into this? Should we re-mark it XFAIL?

@mgxd
Copy link
Member

mgxd commented Sep 30, 2019

yeah, I'm taking a look right now

@effigies
Copy link
Member Author

effigies commented Oct 2, 2019

I pushed 085767c to mark it xfail. We should get back to this at some point.

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

Successfully merging a pull request may close this issue.

3 participants