Skip to content

Internal error "Can't combine line data with arc data" for code using subprocesses #243

Closed
@skirpichev

Description

@skirpichev

While updating travis-ci config of the diofant from dist:trusty to dist:xenial I noticed build failures like this for jobs with coverage profiling enabled.

Little debugging shows, that problem seems to be related with autowrap() function calls. For example, in this scenario:

$ pip install .[exports,develop]
$ cat diofant/tests/test-cov-bug.py 
from diofant.abc import x
from diofant.utilities.autowrap import autowrap
def test_1():
    assert str(x) == 'x'
def test_2():
    f = autowrap(x)
    assert f(0.1) == 0.1
$ py.test --cov diofant diofant/tests/test-cov-bug.py
========================================================= test session starts ==========================================================
platform linux -- Python 3.5.3, pytest-4.0.0, py-1.7.0, pluggy-0.8.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/sk/src/diofant/.hypothesis/examples')
cache: True
ground types: gmpy
rootdir: /home/sk/src/diofant, inifile: setup.cfg
plugins: xdist-1.24.1, timeout-1.3.3, forked-0.2, cov-2.6.0, hypothesis-3.82.1
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 2 items                                                                                                                      
diofant/tests/test-cov-bug.py ..                                                                                                 [100%]
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/_pytest/main.py", line 185, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/_pytest/main.py", line 225, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pytest_cov/plugin.py", line 228, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/pytest_cov/engine.py", line 167, in finish
INTERNALERROR>     self.cov.stop()
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/coverage/control.py", line 818, in combine
INTERNALERROR>     self.data, aliases=aliases, data_paths=data_paths, strict=strict,
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/coverage/data.py", line 736, in combine_parallel_data
INTERNALERROR>     data.update(new_data, aliases=aliases)
INTERNALERROR>   File "/home/sk/venv/dev/lib/python3.5/site-packages/coverage/data.py", line 488, in update
INTERNALERROR>     raise CoverageException("Can't combine line data with arc data")
INTERNALERROR> coverage.misc.CoverageException: Can't combine line data with arc data
======================================================= 2 passed in 3.66 seconds =======================================================

After such test run there are files like .coverage.hostname.1234, which left on the system:

$ cat .coverage.note.3431.337550
!coverage.py: This is a private format, don't read it directly!{"lines":{}}(dev) 

Problem related with the test_2(), if you blacklist this test by -k 'not test_2 - there will be no internal error. Also, as you can see, test_2 itself was passed, problem happens only for coverage builds.

Not sure why everything was working on Trusty's Travis builds (see e.g. this and coverage for autowrap.py seems to be enabled and around 91%), the problem happens to me for all local test runs with same CPython/packages versions as on Travis-CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions