Skip to content

Coverage in parallel failing #883

Closed
Closed
@rowleya

Description

@rowleya

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.

  1. What version of Python are you using?
    3.6
  2. What version of coverage.py are you using? The output of coverage debug sys is helpful.
    5.0
  3. What versions of what packages do you have installed? The output of pip freeze is helpful.
    See above link for details.
  4. 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.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions