Coverage in parallel failing · Issue #883 · nedbat/coveragepy (original) (raw)
Describe the bug
When we run pytest using multiple processes with coverage on our tests, we get an error message that seems to be related to the integration of SQLite. The error we get is available from our integration test suite here:
http://apollo.cs.man.ac.uk:8080/blue/organizations/jenkins/sPyNNaker8%20Integration%20Tests/detail/neuron_recorder_agdr/10/pipeline/102
Replicated a sample of the output here in case this disappears!
[gw7] linux -- Python 3.6.7 /usr/bin/python3
self = <SqliteDb @0x7f9efba0c1d0 debug=None filename='/var/lib/jenkins/workspace/ation_Tests_neuron_recorder_agdr/.coverage' nest=0 con=None>
sql = 'insert into meta (key, value) values (?, ?)'
parameters = ('has_arcs', '1')
def execute(self, sql, parameters=()):
"""Same as :meth:`python:sqlite3.Connection.execute`."""
if self.debug:
tail = " with {!r}".format(parameters) if parameters else ""
self.debug.write("Executing {!r}{}".format(sql, tail))
try:
> return self.con.execute(sql, parameters)
E sqlite3.IntegrityError: UNIQUE constraint failed: meta.key
To Reproduce
How can we reproduce the problem? Please be specific.
- What version of Python are you using?
3.6 - What version of coverage.py are you using? The output of
coverage debug sys
is helpful.
5.0 - What versions of what packages do you have installed? The output of
pip freeze
is helpful.
See above link for details. - What code are you running? Give us a specific commit of a specific repo that we can check out.
Integration tests in Jenkins; see above for details. - What commands did you run?
py.test SpiNNUtils/unittests -rs -n auto --forked --show-progress --cov-branch --cov spynnaker8 --cov spynnaker --cov spinn_front_end_common --cov pacman --cov data_specification --cov spinnman --cov spinn_machine --cov spinn_storage_handlers --cov spalloc --cov spinn_utilities --junitxml junit/SpiNNUtils.xml --cov-report xml:coverage.xml --cov-append --timeout 1200
Expected behavior
A clear and concise description of what you expected to happen.
No error message; protection against writing from mulitple processes through checking for key in database before attempted insert.
Additional context
Add any other context about the problem here.