tests: Cap concurrent Windows guests with a nextest profile

Each Windows integration test boots a full Windows Server guest using
several vCPUs and gigabytes of RAM. nextest runs up to one test per
logical CPU by default, so the whole suite started at once and thrashed
the host.

Add a dedicated 'windows' nextest profile that inherits from
integration and assigns the tests to a 'windows' test group capped at
four concurrent runs. Point the Windows test scripts at the profile and
drop the redundant retries flag, which now comes from the profile.

Running the tests in parallel is safe because every guest gets a unique
network via next_guest_id, so there is no shared address to conflict
over.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-07-19 09:48:29 +02:00
committed by Rob Bradford
parent 5b68d7694d
commit 320c96a9e2
3 changed files with 14 additions and 6 deletions

View File

@@ -2,6 +2,9 @@
# Don't let one individual test run for more than 10 minutes
slow-timeout = { period = "60s", terminate-after = 10 }
[test-groups]
windows = { max-threads = 4 }
[profile.integration]
fail-fast = false
retries = 3
@@ -36,3 +39,12 @@ junit.path = "/root/workloads/junit/ivshmem.xml"
inherits = "integration"
default-filter = 'test(common_cvm::)'
junit.path = "/root/workloads/junit/cvm.xml"
[profile.windows]
inherits = "integration"
default-filter = 'test(windows::)'
junit.path = "/root/workloads/junit/windows.xml"
[[profile.windows.overrides]]
filter = 'test(windows::)'
test-group = 'windows'

View File

@@ -67,9 +67,7 @@ export RUSTFLAGS="$RUSTFLAGS"
cargo build --all --release --target "$BUILD_TARGET"
# Only run with 1 thread to avoid tests interfering with one another because
# Windows has a static IP configured
time cargo nextest run -p cloud-hypervisor --retries 3 --no-tests=pass "windows::$test_filter" --target "$BUILD_TARGET" -- ${test_binary_args[*]}
time cargo nextest run -p cloud-hypervisor --profile windows --no-tests=pass "windows::$test_filter" --target "$BUILD_TARGET" -- ${test_binary_args[*]}
RES=$?
# Tear down the base and any per-test snapshot devices left over from a crash,

View File

@@ -72,9 +72,7 @@ cargo build --features mshv --all --release --target "$BUILD_TARGET"
export RUST_BACKTRACE=1
export RUSTFLAGS="$RUSTFLAGS"
# Only run with 1 thread to avoid tests interfering with one another because
# Windows has a static IP configured
time cargo nextest run -p cloud-hypervisor --retries 3 --no-tests=pass $test_features "windows::$test_filter" --target "$BUILD_TARGET" -- ${test_binary_args[*]}
time cargo nextest run -p cloud-hypervisor --profile windows --no-tests=pass $test_features "windows::$test_filter" --target "$BUILD_TARGET" -- ${test_binary_args[*]}
RES=$?
# Tear down the base and any per-test snapshot devices left over from a crash,