Browse Source

Run Azure integration tests serially under tox

pytest-xdist with -n 5 races against the shared default vnet/subnet:
multiple workers call get_or_create_default cold, all find nothing,
all try to create cloudbridge-net/cloudbridge-subnet, and Azure ARM
rejects all but one with AnotherOperationInProgress or cancels in-
flight create LROs. The losing workers' tests then fail at VM
creation because they have no usable subnet.

Drop the -n 5 default for the azure factor only. Other clouds keep
parallel since their tests don't share singleton default resources
the same way.
Nuwan Goonasekera 12 giờ trước cách đây
mục cha
commit
c4b42f5c96
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      tox.ini

+ 6 - 1
tox.ini

@@ -10,7 +10,12 @@ envlist = py3.13-{aws,azure,gcp,openstack,mock},lint
 
 [testenv]
 commands = # see pyproject.toml for coverage options; setup.cfg for flake8
-           coverage run --source=cloudbridge -m pytest -v {posargs:-n 5 tests/}
+           # Azure integration tests race on the shared default vnet/subnet
+           # under xdist (get_or_create_default has no locking, so two workers
+           # creating the same named resource conflict on Azure ARM). Run the
+           # azure factor serially; other providers stay parallel.
+           !azure: coverage run --source=cloudbridge -m pytest -v {posargs:-n 5 tests/}
+           azure: coverage run --source=cloudbridge -m pytest -v {posargs:tests/}
            # Combine parallel-mode data files and emit Cobertura XML for upload
            # by coverallsapp/github-action in CI. Locally this produces
            # coverage.xml in the project root, which IDEs can also consume.