mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user