@@ -54,6 +54,7 @@ var _ = Describe("Smooth Weighted RR", func() {
5454 for _ , v := range servers {
5555 weight += v .weight
5656 }
57+
5758 return weight
5859 }
5960
@@ -75,6 +76,7 @@ var _ = Describe("Smooth Weighted RR", func() {
7576
7677 validateEmptyLBState := func () {
7778 Expect (lb .ItemCount ()).To (Equal (0 ))
79+
7880 for range 100 {
7981 Expect (lb .Next ()).To (BeNil ())
8082 }
@@ -83,10 +85,12 @@ var _ = Describe("Smooth Weighted RR", func() {
8385 validateLoadBalancingByCount := func (rounds int , servers []server ) {
8486 totalServersWeight := getTotalServesWeight (servers )
8587 results := make (map [string ]int64 )
88+
8689 for range rounds {
8790 s := lb .Next ().(string )
8891 results [s ]++
8992 }
93+
9094 for _ , s := range servers {
9195 expectedWeight := int64 (rounds ) * s .weight / totalServersWeight
9296 // Expected weight should be +-1 from the weight counted
@@ -170,6 +174,7 @@ var _ = Describe("Smooth Weighted RR", func() {
170174 It ("Next() should return it all the time" , func () {
171175 s := servers [0 ]
172176 addServer (s )
177+
173178 for range 10 {
174179 Expect (lb .Next ()).To (Equal (s .name ))
175180 }
@@ -192,6 +197,7 @@ var _ = Describe("Smooth Weighted RR", func() {
192197 err := lb .Add (s .name , s .weight )
193198 Expect (err ).ToNot (HaveOccurred ())
194199 }
200+
195201 for range 100 {
196202 for _ , s := range roundRobinServers {
197203 Expect (lb .Next ().(string )).To (Equal (s .name ))
0 commit comments