Skip to content

Commit 0e1d5cd

Browse files
hanwen-clusterHimani Anil Deshpande
authored andcommitted
[integ-tests-framework] Improve serial_execution_by_instance to consider different platforms
Capacity reservations have different platforms. It is not necessary to serialize across different platforms because they are using different capacity reservations
1 parent 4fe4668 commit 0e1d5cd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/integration-tests/conftest.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,12 +1167,13 @@ def s3_bucket_key_prefix():
11671167

11681168

11691169
@pytest.fixture(scope="class")
1170-
def serial_execution_by_instance(request, instance, region):
1170+
def serial_execution_by_instance(request, instance, region, os_platform):
11711171
"""Enforce serial execution of tests, according to the adopted instance."""
11721172
if instance in ["c5n.18xlarge"] or instance.startswith("p"):
1173-
logging.info("Enforcing serial execution for instance %s", instance)
1173+
logging.info("Enforcing serial execution for instance %s, platform %s", instance, os_platform)
11741174
outdir = request.config.getoption("output_dir")
1175-
lock_file = f"{outdir}/{instance}{region}.lock"
1175+
os_platform = os_platform.replace(" ", "")
1176+
lock_file = f"{outdir}/{instance}{os_platform}{region}.lock"
11761177
lock = FileLock(lock_file=lock_file)
11771178
logging.info("Acquiring lock file %s", lock.lock_file)
11781179
with lock.acquire(poll_interval=15, timeout=12000):
@@ -1196,6 +1197,15 @@ def architecture(request, instance, region):
11961197
return supported_architecture
11971198

11981199

1200+
@pytest.fixture(scope="class")
1201+
def os_platform(os):
1202+
"""Return platform according to OS."""
1203+
os_platform = "Linux/UNIX"
1204+
if "rhel" in os.lower():
1205+
os_platform = "Red Hat Enterprise Linux"
1206+
return os_platform
1207+
1208+
11991209
@pytest.fixture()
12001210
def network_interfaces_count(request, instance, region):
12011211
"""Return the number of network interfaces for the given instance type."""

0 commit comments

Comments
 (0)