Skip to content

Data files missing or empty when using tox --parallel auto #1642

Open
@avylove

Description

@avylove

Describe the bug
When running with tox --parallel auto, files are missing or empty

To Reproduce

Environment: Python 3.11.2 on Fedora 38, Tox 4.6.1
Tox is installing the latest coverage, 7.2.7

  1. git clone https://github.com/jquast/blessed.git
  2. cd blessed
  3. tox --parallel auto -e py37,py38,py39,py310,py311,py312 -- --quiet

Pytest configuration (in tox.ini):

[pytest]
addopts =
    --color=yes
    --cov
    --cov-append
    --cov-report=xml
    --disable-pytest-warnings
    --ignore=setup.py
    --ignore=.tox
    --junit-xml=.tox/results.{envname}.xml
filterwarnings = error
junit_family = xunit1
log_format=%(levelname)s %(relativeCreated)2.2f %(filename)s:%(lineno)d %(message)s
norecursedirs = .git .tox build

I'll get one of these two errors for several of the Tox environments

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pluggy/_callers.py", line 55, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pytest_cov/plugin.py", line 298, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "blessed/.tox/py310/lib/python3.10/site-packages/pytest_cov/engine.py", line 254, in finish
INTERNALERROR>     self.cov.combine()
INTERNALERROR>   File "blessed/.tox/py310/lib64/python3.10/site-packages/coverage/control.py", line 809, in combine
INTERNALERROR>     combine_parallel_data(
INTERNALERROR>   File "blessed/.tox/py310/lib64/python3.10/site-packages/coverage/data.py", line 148, in combine_parallel_data
INTERNALERROR>     with open(f, "rb") as fobj:
INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory: 'blessed/.coverage.localhost.276645.761168'
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/sqldata.py", line 1173, in _execute
INTERNALERROR>     return self.con.execute(sql, parameters)    # type: ignore[arg-type]
INTERNALERROR> sqlite3.OperationalError: no such table: file
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/sqldata.py", line 1178, in _execute
INTERNALERROR>     return self.con.execute(sql, parameters)    # type: ignore[arg-type]
INTERNALERROR> sqlite3.OperationalError: no such table: file
INTERNALERROR> 
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pytest_cov/plugin.py", line 298, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "blessed/.tox/py38/lib/python3.8/site-packages/pytest_cov/engine.py", line 249, in finish
INTERNALERROR>     self.cov.stop()
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/control.py", line 809, in combine
INTERNALERROR>     combine_parallel_data(
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/data.py", line 171, in combine_parallel_data
INTERNALERROR>     data.update(new_data, aliases=aliases)
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/sqldata.py", line 670, in update
INTERNALERROR>     with con.execute("select path from file") as cur:
INTERNALERROR>   File "/usr/lib64/python3.8/contextlib.py", line 113, in __enter__
INTERNALERROR>     return next(self.gen)
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/sqldata.py", line 1207, in execute
INTERNALERROR>     cur = self._execute(sql, parameters)
INTERNALERROR>   File "blessed/.tox/py38/lib64/python3.8/site-packages/coverage/sqldata.py", line 1195, in _execute
INTERNALERROR>     raise DataError(f"Couldn't use data file {self.filename!r}: {msg}") from exc
INTERNALERROR> coverage.exceptions.DataError: Couldn't use data file 'blessed/.coverage.localhost.277041.519776': no such table: file

Expected behavior
No errors

Additional context
These tests spawn a lot of subprocesses, hundreds, if not thousands. I never have any issues running a single environment, but as soon as there are two, this issue is likely to surface.
Seems like it could be a syncing issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions