Skip to content

Commit 6aa4615

Browse files
craig[bot]herkolategan
andcommitted
108363: sctest: loop var capture fix r=renatolabs a=herkolategan `tc` variable will be captured by reference in a loop and used by a parallel test, resulting in only the last case being tested. This change captures `tc`. Release note: None Epic: None Co-authored-by: Herko Lategan <[email protected]>
2 parents 4c34b48 + e062320 commit 6aa4615

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/sql/schemachanger/sctest/framework.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ func cumulativeTestForEachPostCommitStage(
712712
}
713713
var hasFailed bool
714714
for _, tc := range testCases {
715+
tc := tc // capture loop variable
715716
fn := func(t *testing.T) {
716717
tf(t, tc)
717718
}

0 commit comments

Comments
 (0)