Skip to content

Commit 40eb900

Browse files
committed
fix(test/live): skip partial-return capacity test when weighted scenario yields <2 instances
EC2Fleet Maintain + spot uses weighted vmTypes, so capacity_to_request=4 can be fulfilled by a single physical instance with WeightedCapacity=4. The partial-return-reduces-capacity test needs at least 2 physical instances to terminate one and verify the other survives. Mirrors the existing skip in test_partial_return_terminates_instance_only (line 2237).
1 parent 2ea5ac1 commit 40eb900

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/providers/aws/live/test_onaws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,10 @@ def test_partial_return_reduces_capacity(setup_host_factory_mock_with_scenario,
19591959
log.info("1.6: Extracting provisioned instance information")
19601960
machines = status_response["requests"][0]["machines"]
19611961
machine_ids = [m.get("machineId") or m.get("machine_id") for m in machines]
1962-
assert len(machine_ids) >= 2, "Partial return test requires capacity > 1"
1962+
if len(machine_ids) < 2:
1963+
pytest.skip(
1964+
f"Only {len(machine_ids)} physical instance(s) provisioned (weighted capacity scenario) — need 2+ for partial return test"
1965+
)
19631966
log.info("Provisioned %d instances: %s", len(machine_ids), machine_ids)
19641967

19651968
# === STEP 2: PARTIAL RETURN AND CAPACITY VERIFICATION ===

0 commit comments

Comments
 (0)