Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove loopclosure captures from tests #15202

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go/flagutil/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func TestStringEnum(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
var enum *StringEnum
if tt.caseInsensitive {
Expand Down
4 changes: 0 additions & 4 deletions go/protoutil/duration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ func TestDurationFromProto(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {

actual, ok, err := DurationFromProto(tt.in)
Expand Down Expand Up @@ -124,8 +122,6 @@ func TestDurationToProto(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {

actual := DurationToProto(tt.in)
Expand Down
3 changes: 0 additions & 3 deletions go/vt/callinfo/callinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func TestNewContext(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedContext, NewContext(tt.ctx, tt.ci))
})
Expand Down Expand Up @@ -84,7 +83,6 @@ func TestFromContext(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
ci, ok := FromContext(tt.ctx)
require.Equal(t, tt.expectedCi, ci)
Expand Down Expand Up @@ -112,7 +110,6 @@ func TestHTMLFromContext(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.expectedHTML, HTMLFromContext(tt.ctx))
})
Expand Down
1 change: 0 additions & 1 deletion go/vt/logz/logz_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func TestWrappable(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.input, func(t *testing.T) {
require.Equal(t, tt.output, Wrappable(tt.input))
})
Expand Down
1 change: 0 additions & 1 deletion go/vt/topo/topotests/cell_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func TestExpandCells(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
expanded, err := ts.ExpandCells(ctx, tt.in)
if tt.shouldErr {
Expand Down
36 changes: 0 additions & 36 deletions go/vt/vtadmin/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,6 @@ func TestFindSchema(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -862,8 +860,6 @@ func TestGetClusters(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1052,8 +1048,6 @@ func TestGetKeyspace(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1284,8 +1278,6 @@ func TestGetKeyspaces(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1538,8 +1530,6 @@ func TestGetSchema(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -2179,8 +2169,6 @@ func TestGetSchemas(t *testing.T) {
// Note that these test cases were written prior to the existence of
// WithTestServers, so they are all written with the assumption that
// there are exactly 2 clusters.
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -2626,8 +2614,6 @@ func TestGetSrvKeyspace(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -2787,8 +2773,6 @@ func TestGetSrvKeyspaces(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -2956,8 +2940,6 @@ func TestGetSrvVSchema(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -3250,8 +3232,6 @@ func TestGetSrvVSchemas(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithCancel(context.Background())
Expand Down Expand Up @@ -3531,8 +3511,6 @@ func TestGetTablet(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -3726,8 +3704,6 @@ func TestGetTablets(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -3872,8 +3848,6 @@ func TestGetVSchema(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -4198,8 +4172,6 @@ func TestGetVSchemas(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -4419,8 +4391,6 @@ func TestGetWorkflow(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -4858,8 +4828,6 @@ func TestGetWorkflows(t *testing.T) {
ctx := context.Background()

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -5099,8 +5067,6 @@ func TestVTExplain(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down Expand Up @@ -5350,8 +5316,6 @@ func TestServeHTTP(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions go/vt/vtadmin/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func TestBackfillDuplicates(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -131,7 +130,6 @@ func TestBackfillTTL(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions go/vt/vtadmin/cache/refresh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func TestShouldRefreshFromIncomingContext(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -114,7 +113,6 @@ func TestShouldRefreshFromRequest(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
20 changes: 0 additions & 20 deletions go/vt/vtadmin/cluster/cluster_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ func TestDeleteTablets(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -331,8 +329,6 @@ func TestEmergencyFailoverShard(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -493,8 +489,6 @@ func Test_getShardSets(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -662,8 +656,6 @@ func TestPlannedFailoverShard(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -775,8 +767,6 @@ func TestRefreshState(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -899,8 +889,6 @@ func TestRefreshTabletReplicationSource(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1189,8 +1177,6 @@ func Test_reloadKeyspaceSchemas(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1516,8 +1502,6 @@ func Test_reloadShardSchemas(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1700,8 +1684,6 @@ func Test_reloadTabletSchemas(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -1903,8 +1885,6 @@ func TestTabletExternallyPromoted(t *testing.T) {
}

for _, tt := range tests {
tt := tt

t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading
Loading