Skip to content

Commit ff6423e

Browse files
committed
chore: run goimports
1 parent 6f1896a commit ff6423e

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

pkg/activator/net/lb_policy_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ func TestRandomLBPolicyWithNilTrackers(t *testing.T) {
370370
podTrackers := makeTrackers(3, 0)
371371
// Set middle one to nil
372372
podTrackers[1] = nil
373-
373+
374374
// Run multiple times to ensure we don't get nil
375-
for i := 0; i < 10; i++ {
375+
for range 10 {
376376
cb, pt := randomLBPolicy(context.Background(), podTrackers)
377377
defer cb()
378378
if pt == nil {
@@ -409,10 +409,10 @@ func TestRandomChoice2PolicyWithNilTrackers(t *testing.T) {
409409
// Set some to nil
410410
podTrackers[1] = nil
411411
podTrackers[3] = nil
412-
412+
413413
// Run multiple times to check behavior
414414
foundNonNil := false
415-
for i := 0; i < 20; i++ {
415+
for range 20 {
416416
cb, pt := randomChoice2Policy(context.Background(), podTrackers)
417417
defer cb()
418418
if pt != nil {
@@ -437,10 +437,10 @@ func TestRandomChoice2PolicyWithNilTrackers(t *testing.T) {
437437
// Initialize the weight field properly
438438
validTracker.weight.Store(0)
439439
podTrackers[0] = validTracker
440-
440+
441441
// Run multiple times - should eventually find the valid tracker
442442
foundValid := false
443-
for i := 0; i < 100; i++ {
443+
for range 100 {
444444
cb, pt := randomChoice2Policy(context.Background(), podTrackers)
445445
if cb != nil {
446446
defer cb()
@@ -496,13 +496,13 @@ func TestRoundRobinWithNilTrackers(t *testing.T) {
496496
podTrackers := makeTrackers(3, 1)
497497
// Set middle tracker to nil
498498
podTrackers[1] = nil
499-
499+
500500
cb, pt := rrp(context.Background(), podTrackers)
501501
t.Cleanup(cb)
502502
if got, want := pt, podTrackers[0]; got != want {
503503
t.Fatalf("Tracker = %v, want: %v", got, want)
504504
}
505-
505+
506506
// Should skip nil tracker and go to next valid one
507507
cb, pt = rrp(context.Background(), podTrackers)
508508
t.Cleanup(cb)
@@ -514,7 +514,7 @@ func TestRoundRobinWithNilTrackers(t *testing.T) {
514514
t.Run("all nil trackers", func(t *testing.T) {
515515
rrp := newRoundRobinPolicy()
516516
podTrackers := []*podTracker{nil, nil, nil}
517-
517+
518518
cb, pt := rrp(context.Background(), podTrackers)
519519
defer cb()
520520
if pt != nil {

pkg/activator/net/throttler_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ func TestRevisionThrottlerWithCustomPolicy(t *testing.T) {
15471547

15481548
func TestRevisionThrottlerConcurrencyOverflow(t *testing.T) {
15491549
logger := TestLogger(t)
1550-
1550+
15511551
// Test with negative containerConcurrency
15521552
rt := newRevisionThrottler(
15531553
types.NamespacedName{Namespace: "test", Name: "test"},
@@ -1557,21 +1557,21 @@ func TestRevisionThrottlerConcurrencyOverflow(t *testing.T) {
15571557
testBreakerParams,
15581558
logger,
15591559
)
1560-
1560+
15611561
if cc := rt.containerConcurrency.Load(); cc != 0 {
15621562
t.Errorf("Negative containerConcurrency should be stored as 0, got %d", cc)
15631563
}
1564-
1564+
15651565
// Test with very large containerConcurrency
15661566
rt = newRevisionThrottler(
15671567
types.NamespacedName{Namespace: "test", Name: "test"},
15681568
nil,
1569-
int(^uint32(0)) + 100, // Larger than max uint32
1569+
int(^uint32(0))+100, // Larger than max uint32
15701570
"http",
15711571
testBreakerParams,
15721572
logger,
15731573
)
1574-
1574+
15751575
if cc := rt.containerConcurrency.Load(); cc != ^uint32(0) {
15761576
t.Errorf("Large containerConcurrency should be capped at max uint32, got %d", cc)
15771577
}
@@ -1584,18 +1584,18 @@ func TestHandlePubEpsUpdateWithNegativeValues(t *testing.T) {
15841584
}
15851585
rt.numActivators.Store(5)
15861586
rt.activatorIndex.Store(2)
1587-
1587+
15881588
// Create endpoints with empty addresses
15891589
eps := &corev1.Endpoints{
15901590
ObjectMeta: metav1.ObjectMeta{
15911591
Name: networking.ActivatorServiceName,
15921592
},
15931593
Subsets: []corev1.EndpointSubset{},
15941594
}
1595-
1595+
15961596
// This should result in negative values for newNA
15971597
rt.handlePubEpsUpdate(eps, "10.10.10.10")
1598-
1598+
15991599
// numActivators should not change when newNA is negative
16001600
if na := rt.numActivators.Load(); na != 5 {
16011601
t.Errorf("numActivators should remain unchanged when newNA is negative, got %d", na)

0 commit comments

Comments
 (0)