@@ -651,15 +651,15 @@ func TestAvailabilityBasedScaling(t *testing.T) {
651651
652652func TestDanglingInstanceDetection (t * testing.T ) {
653653 testCases := []struct {
654- name string
655- metrics buildkite.AgentMetrics
656- asgDesired int64
657- asgActual int64
658- maxSize int64
659- agentsPerInstance int
660- elasticCIMode bool
661- expectedDesiredCapacity int64
662- expectedDanglingChecks int
654+ name string
655+ metrics buildkite.AgentMetrics
656+ asgDesired int64
657+ asgActual int64
658+ maxSize int64
659+ agentsPerInstance int
660+ elasticCIMode bool
661+ expectedDesiredCapacity int64
662+ expectedDanglingChecks int
663663 }{
664664 // Core scenario from SUP-5153: agents die on running instance, MaxSize=1 caps
665665 // desired to 1, scaler sees desired==actual and says "No scaling required".
@@ -672,13 +672,13 @@ func TestDanglingInstanceDetection(t *testing.T) {
672672 WaitingJobs : 7 ,
673673 TotalAgents : 0 ,
674674 },
675- asgDesired : 1 ,
676- asgActual : 1 ,
677- maxSize : 1 ,
678- agentsPerInstance : 6 ,
679- elasticCIMode : true ,
680- expectedDesiredCapacity : 1 , // capacity unchanged — cleanup handles recovery
681- expectedDanglingChecks : 1 ,
675+ asgDesired : 1 ,
676+ asgActual : 1 ,
677+ maxSize : 1 ,
678+ agentsPerInstance : 6 ,
679+ elasticCIMode : true ,
680+ expectedDesiredCapacity : 1 , // capacity unchanged — cleanup handles recovery
681+ expectedDanglingChecks : 1 ,
682682 },
683683 // Same scenario but without Elastic CI Mode — should NOT trigger dangling check.
684684 {
@@ -689,13 +689,13 @@ func TestDanglingInstanceDetection(t *testing.T) {
689689 WaitingJobs : 7 ,
690690 TotalAgents : 0 ,
691691 },
692- asgDesired : 1 ,
693- asgActual : 1 ,
694- maxSize : 1 ,
695- agentsPerInstance : 6 ,
696- elasticCIMode : false ,
697- expectedDesiredCapacity : 1 ,
698- expectedDanglingChecks : 0 ,
692+ asgDesired : 1 ,
693+ asgActual : 1 ,
694+ maxSize : 1 ,
695+ agentsPerInstance : 6 ,
696+ elasticCIMode : false ,
697+ expectedDesiredCapacity : 1 ,
698+ expectedDanglingChecks : 0 ,
699699 },
700700 // When there are zero instances AND zero agents (normal idle state),
701701 // should NOT trigger dangling check — there's nothing dangling.
@@ -706,13 +706,13 @@ func TestDanglingInstanceDetection(t *testing.T) {
706706 RunningJobs : 0 ,
707707 TotalAgents : 0 ,
708708 },
709- asgDesired : 0 ,
710- asgActual : 0 ,
711- maxSize : 1 ,
712- agentsPerInstance : 6 ,
713- elasticCIMode : true ,
714- expectedDesiredCapacity : 0 ,
715- expectedDanglingChecks : 0 ,
709+ asgDesired : 0 ,
710+ asgActual : 0 ,
711+ maxSize : 1 ,
712+ agentsPerInstance : 6 ,
713+ elasticCIMode : true ,
714+ expectedDesiredCapacity : 0 ,
715+ expectedDanglingChecks : 0 ,
716716 },
717717 // When agents are healthy (total > 0), no dangling check needed.
718718 {
@@ -722,13 +722,13 @@ func TestDanglingInstanceDetection(t *testing.T) {
722722 RunningJobs : 0 ,
723723 TotalAgents : 6 ,
724724 },
725- asgDesired : 1 ,
726- asgActual : 1 ,
727- maxSize : 1 ,
728- agentsPerInstance : 6 ,
729- elasticCIMode : true ,
730- expectedDesiredCapacity : 0 , // scales in to 0 (idle agents, no jobs)
731- expectedDanglingChecks : 0 ,
725+ asgDesired : 1 ,
726+ asgActual : 1 ,
727+ maxSize : 1 ,
728+ agentsPerInstance : 6 ,
729+ elasticCIMode : true ,
730+ expectedDesiredCapacity : 0 , // scales in to 0 (idle agents, no jobs)
731+ expectedDanglingChecks : 0 ,
732732 },
733733 // Multiple instances with zero agents — should still trigger dangling check.
734734 {
@@ -738,13 +738,13 @@ func TestDanglingInstanceDetection(t *testing.T) {
738738 RunningJobs : 0 ,
739739 TotalAgents : 0 ,
740740 },
741- asgDesired : 3 ,
742- asgActual : 3 ,
743- maxSize : 3 ,
744- agentsPerInstance : 4 ,
745- elasticCIMode : true ,
746- expectedDesiredCapacity : 3 , // capacity unchanged — cleanup handles recovery
747- expectedDanglingChecks : 1 ,
741+ asgDesired : 3 ,
742+ asgActual : 3 ,
743+ maxSize : 3 ,
744+ agentsPerInstance : 4 ,
745+ elasticCIMode : true ,
746+ expectedDesiredCapacity : 3 , // capacity unchanged — cleanup handles recovery
747+ expectedDanglingChecks : 1 ,
748748 },
749749 }
750750
0 commit comments