Skip to content
Open
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
3 changes: 0 additions & 3 deletions client/history/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ func (c *clientImpl) GetReplicationMessages(
peerResponses := make([]*getReplicationMessagesWithSize, 0, len(requestsByPeer))

for peer, req := range requestsByPeer {
peer, req := peer, req
g.Go(func() (e error) {
defer func() { log.CapturePanic(recover(), c.logger, &e) }()

Expand Down Expand Up @@ -929,7 +928,6 @@ func (c *clientImpl) CountDLQMessages(

g := &errgroup.Group{}
for _, peer := range peers {
peer := peer
g.Go(func() (e error) {
defer func() { log.CapturePanic(recover(), c.logger, &e) }()

Expand Down Expand Up @@ -1035,7 +1033,6 @@ func (c *clientImpl) NotifyFailoverMarkers(

g := &errgroup.Group{}
for peer, req := range requestsByPeer {
peer, req := peer, req
g.Go(func() (e error) {
defer func() { log.CapturePanic(recover(), c.logger, &e) }()
return c.client.NotifyFailoverMarkers(ctx, req, append(opts, yarpc.WithShardKey(peer))...)
Expand Down
2 changes: 0 additions & 2 deletions client/history/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,6 @@ func TestClient_withResponse(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
Expand Down Expand Up @@ -1279,7 +1278,6 @@ func TestClient_withNoResponse(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
Expand Down
2 changes: 0 additions & 2 deletions client/history/peer_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func TestPeerResolver(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
controller := gomock.NewController(t)
serviceResolver := membership.NewMockResolver(controller)
Expand Down Expand Up @@ -205,7 +204,6 @@ func TestPeerResolver(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
controller := gomock.NewController(t)
serviceResolver := membership.NewMockResolver(controller)
Expand Down
2 changes: 0 additions & 2 deletions client/matching/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func TestClient_withoutResponse(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {

// setting up client
Expand Down Expand Up @@ -534,7 +533,6 @@ func TestClient_withResponse(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {

// setting up client
Expand Down
2 changes: 0 additions & 2 deletions common/clock/ratelimiter_comparison_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ func assertRatelimitersBehaveSimilarly(t *testing.T, burst int, minWaitDuration
ticker := time.NewTicker(fuzzGranularity)
defer ticker.Stop()
for round := range schedule {
round := round // for closure
for event := range schedule[round] {
event := event // for closure
<-ticker.C
ts.Advance(fuzzGranularity) // may also be advanced inside wait
debugLogf(t, "Tokens before round, real: %0.2f, wrapped: %0.2f, mocked: %0.2f", actual.Tokens(), wrapped.Tokens(), mocked.Tokens())
Expand Down
3 changes: 0 additions & 3 deletions common/clock/ratelimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestRatelimiter(t *testing.T) {
t.Parallel()

for _, name := range []string{"real", "mocked"} {
name := name
t.Run(name, func(t *testing.T) {
t.Parallel()
ts := func() MockedTimeSource { return nil }
Expand Down Expand Up @@ -250,7 +249,6 @@ func assertRatelimiterBasicsWork(t *testing.T, makeTimesource func() MockedTimeS
tokenChange: -2, // would be -3 if it went negative
},
} {
name, tc := name, tc
t.Run(name, func(t *testing.T) {
t.Parallel()
ts := makeTimesource()
Expand Down Expand Up @@ -401,7 +399,6 @@ func assertRatelimiterBasicsWork(t *testing.T, makeTimesource func() MockedTimeS
tokenChange: 0.5, // only waited for half an event -> recovered half a token
},
} {
name, tc := name, tc
t.Run(name, func(t *testing.T) {
t.Parallel()
ts := makeTimesource()
Expand Down
1 change: 0 additions & 1 deletion common/peerprovider/ringpopprovider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func TestRingpopProvider(t *testing.T) {
// start ringpop provider for each channel
var wg sync.WaitGroup
for i, svc := range allServicesAndChs {
svc := svc
cfg := cfg
if i == 0 {
// set broadcast address for the first provider to test that path
Expand Down
1 change: 0 additions & 1 deletion common/persistence/client/bean_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func TestBeanCoverage(t *testing.T) {
},
}
for name, test := range tests {
name, test := name, test
t.Run(name, func(t *testing.T) {
t.Parallel()
f, _, defaultMocks := beanSetup(t)
Expand Down
1 change: 0 additions & 1 deletion common/persistence/serializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ func TestSerializers(t *testing.T) {
}

for _, tc := range runnableTests {
tc := tc
t.Run(fmt.Sprintf("%s with encoding:%s,payload:%s", tc.name, tc.encoding, tc.payloadName), func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions common/quotas/global/collection/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func TestCollectionLimitersCollectMetrics(t *testing.T) {
}

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

Expand Down Expand Up @@ -464,7 +463,6 @@ func TestBoostRPS(t *testing.T) {
},
}
for name, tc := range tests {
name, tc := name, tc
t.Run(name, func(t *testing.T) {
t.Parallel()
assert.GreaterOrEqual(t, tc.weight, float64(0), "sanity check on weight")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func TestShadowed(t *testing.T) {
},
}
for name, test := range tests {
test := test
t.Run("allow-"+name, func(t *testing.T) {
ts := clock.NewMockedTimeSource()
primaryBurst, shadowBurst := 0, 0
Expand Down
1 change: 0 additions & 1 deletion common/quotas/global/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func (c *client) Update(ctx context.Context, period time.Duration, load map[shar
// but as each goes to a different host this seems fine to just blast out all at once,
// and it makes timeouts easy because we don't need to reserve room for queued calls.
for peer, peerKeys := range peers {
peer, peerKeys := peer, peerKeys // for closure
g.Go(func() (err error) {
defer func() { log.CapturePanic(recover(), c.logger, &err) }()

Expand Down
1 change: 0 additions & 1 deletion common/quotas/global/rpc/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func TestMapping(t *testing.T) {
},
}
for name, test := range tests {
test := test
t.Run(name, func(t *testing.T) {
require.ErrorContains(t, test.do(test.value), test.errContains)
})
Expand Down
1 change: 0 additions & 1 deletion common/quotas/global/shared/sanity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestSanityChecks(t *testing.T) {
"inclusive upper": {lower: 0, actual: 10, upper: 10, expected: ""},
}
for name, test := range tests {
name, test := name, test
t.Run(name, func(t *testing.T) {
msg := SanityCheckFloat(test.lower, test.actual, test.upper, "test")
if test.expected == "" {
Expand Down
2 changes: 0 additions & 2 deletions common/types/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func TestIsolationGroupConfigurationDeepCopy(t *testing.T) {
},
}
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
got := tc.input.DeepCopy()
assert.Equal(t, tc.input, got)
Expand Down Expand Up @@ -157,7 +156,6 @@ func TestAsyncWorkflowConfigurationDeepCopy(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
got := tc.input.DeepCopy()
assert.Equal(t, tc.input, got)
Expand Down
1 change: 0 additions & 1 deletion common/types/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func TestDataBlobDeepCopy(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
got := tc.input.DeepCopy()
assert.Equal(t, tc.input, got)
Expand Down
1 change: 0 additions & 1 deletion service/history/execution/mutable_state_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func convertSyncActivityInfos(
func convertWorkflowRequests(inputs map[persistence.WorkflowRequest]struct{}) []*persistence.WorkflowRequest {
outputs := make([]*persistence.WorkflowRequest, 0, len(inputs))
for key := range inputs {
key := key // TODO: remove this trick once we upgrade go to 1.22
outputs = append(outputs, &key)
}
return outputs
Expand Down
1 change: 0 additions & 1 deletion service/history/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,6 @@ func (h *handlerImpl) CountDLQMessages(
var mu sync.Mutex
entries := map[types.HistoryDLQCountKey]int64{}
for _, shardID := range h.controller.ShardIDs() {
shardID := shardID
g.Go(func() (e error) {
defer func() { log.CapturePanic(recover(), h.GetLogger(), &e) }()

Expand Down
2 changes: 1 addition & 1 deletion service/matching/tasklist/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ func TestRatelimitBehavior(t *testing.T) {
},
}
for name, test := range tests {
test := test // closure copy
// closure copy
t.Run(name, func(t *testing.T) {
t.Parallel()
check := func(t *testing.T, allow func() bool, allowable func(ctx context.Context) (*rate.Reservation, error)) {
Expand Down
1 change: 0 additions & 1 deletion service/matching/tasklist/task_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func newTaskReader(tlMgr *taskListManagerImpl, isolationGroups []string) *taskRe
func (tr *taskReader) Start() {
tr.Signal()
for g := range tr.taskBuffers {
g := g
tr.stopWg.Add(1)
go func() {
defer tr.stopWg.Done()
Expand Down
1 change: 0 additions & 1 deletion simulation/replication/replication_simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func TestReplicationSimulation(t *testing.T) {
startTime := time.Now().UTC()
simTypes.Logf(t, "Simulation start time: %v", startTime)
for i, op := range simCfg.Operations {
op := op
waitForOpTime(t, op, startTime)
var err error
switch op.Type {
Expand Down
1 change: 0 additions & 1 deletion simulation/replication/worker/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func main() {

wg := sync.WaitGroup{}
for domainName := range simCfg.Domains {
domainName := domainName
wg.Add(1)

go func() {
Expand Down
1 change: 0 additions & 1 deletion tools/cli/admin_db_decode_thrift_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func TestThriftDecodeHelper(t *testing.T) {
}

for _, tc := range tests {
tc := tc
t.Run(tc.desc, func(t *testing.T) {
t.Parallel()
data, err := decodeUserInput(tc.input, tc.encoding)
Expand Down
Loading