SUSE / rookcheck

Apache License 2.0
4 stars 11 forks source link

hardware/libvirt: add lock for libvirt defineXML #214

Closed kshtsk closed 3 years ago

kshtsk commented 3 years ago

On some version of libvirt the "Duplicate key" internal error occurs while trying to define a node in parallel, for example:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/kyr/suse/rookcheck/tests/lib/hardware/libvirt.py", line 400, in _boot_node
    node = self.node_create(name, role, tags)
  File "/home/kyr/suse/rookcheck/tests/lib/hardware/libvirt.py", line 396, in node_create
    node.boot()
  File "/home/kyr/suse/rookcheck/tests/lib/hardware/libvirt.py", line 75, in boot
    self._dom = self._conn.defineXML(xml)
  File "/home/kyr/suse/rookcheck/.tox/py36/lib64/python3.6/site-packages/libvirt.py", line 4049, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirt.libvirtError: internal error: Duplicate key

This patch adds a workaround for it.

Fixes: https://github.com/SUSE/rookcheck/issues/161

Signed-off-by: Kyr Shatskyy kyrylo.shatskyy@suse.com

jhesketh commented 3 years ago

lgtm minus what Thomas highlighted.

kshtsk commented 3 years ago


PASSED tests/test_basic.py::test_deploy_filesystem

PASSED tests/test_basic.py::test_file_creation

PASSED tests/test_basic.py::test_service_mons

PASSED tests/test_basic.py::test_services

PASSED tests/test_basic.py::test_service_rbd

PASSED tests/test_basic.py::test_osd_number

PASSED tests/test_basic.py::test_mons_up_down

PASSED tests/test_basic.py::test_rbd_pvc

XFAIL tests/test_basic.py::test_add_node

  This is currently failing due to https://github.com/rook/rook/issues/6214

FAILED tests/test_basic.py::test_add_storage - Failed: we expect 4 osds, but ...

====== 1 failed, 8 passed, 1 xfailed, 2587 warnings in 2977.91s (0:49:37) ======

ERROR: InvocationError for command /home/jenkins/swarm/workspace/rookcheck-integration_PR-214/sles_venv/py3/bin/py.test -s -o junit_suite_name=SLES_CaaSP --junitxml junit-results/SLES_CaaSP.xml tests/test_basic.py (exited with code 1)

___________________________________ summary ____________________________________```
kshtsk commented 3 years ago

Jenkins tests are failing because of lame test_add_node