fix: use available instance types in allocation test to prevent flaky CI

The FilterUnavailableTypesAfterAllocation test picked a random 2-vCPU
type from the raw instance type map, which could include memory-hungry
types (e.g. r5a.large at 16 GB) that exceed host RAM on CI runners
(~15.6 GB). Now picks from the already-filtered available types list.
This commit is contained in:
Julian Sommer
2026-02-17 13:30:44 +10:00
parent 1735a46f11
commit b7396b97c0
+3 -2
View File
@@ -683,10 +683,11 @@ func TestHandleEC2DescribeInstanceTypes(t *testing.T) {
initialCount := len(initialOutput.InstanceTypes)
t.Logf("Initial available instance types: %d", initialCount)
// Find an instance type that uses 2 vCPUs
// Find an instance type that uses 2 vCPUs from the available types
// (not the raw map, which may contain types that exceed host memory)
var instanceType2CPU *ec2.InstanceTypeInfo
var instanceTypeName string
for _, it := range daemon.resourceMgr.instanceTypes {
for _, it := range initialOutput.InstanceTypes {
if it.VCpuInfo != nil && it.VCpuInfo.DefaultVCpus != nil && *it.VCpuInfo.DefaultVCpus == 2 {
instanceType2CPU = it
if it.InstanceType != nil {