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
1 change: 0 additions & 1 deletion module/chunks/chunkVerifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ func generateEvents(t *testing.T, collection *flow.Collection, includeServiceEve
// service events are also included as regular events
if includeServiceEvent {
for _, e := range serviceEventsList {
e := e
event, err := convert.ServiceEvent(testChain, e)
require.NoError(t, err)

Expand Down
1 change: 0 additions & 1 deletion module/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ func (c *ComponentManager) Start(parent irrecoverable.SignalerContext) {

// launch workers
for _, worker := range c.workers {
worker := worker
go func() {
defer workersDone.Done()
var readyOnce sync.Once
Expand Down
2 changes: 0 additions & 2 deletions module/component/component_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ func (c *ComponentManagerMachine) ExecuteStateTransition(t *rapid.T) {
}

for i, workerId := range st.workerIDs {
i := i
workerId := workerId
addTransition(func() {
wst := st.workerTransitions[i]
t.Logf("executing worker %v transition: %v\n", workerId, wst)
Expand Down
2 changes: 0 additions & 2 deletions module/executiondatasync/execution_data/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func (d *downloader) Get(ctx context.Context, executionDataID flow.Identifier) (
var mu sync.Mutex

for i, chunkDataID := range edRoot.ChunkExecutionDataIDs {
i := i
chunkDataID := chunkDataID

g.Go(func() error {
ced, cids, err := d.getChunkExecutionData(
Expand Down
2 changes: 0 additions & 2 deletions module/executiondatasync/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ func (p *ExecutionDataProvider) provide(ctx context.Context, blockHeight uint64,

chunkDataIDs := make([]cid.Cid, len(executionData.ChunkExecutionDatas))
for i, chunkExecutionData := range executionData.ChunkExecutionDatas {
i := i
chunkExecutionData := chunkExecutionData

g.Go(func() error {
logger.Debug().Int("chunk_index", i).Msg("adding chunk execution data")
Expand Down
1 change: 0 additions & 1 deletion module/mempool/queue/heroQueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func TestHeroQueue_Concurrent(t *testing.T) {
entities := unittest.EntityListFixture(uint(sizeLimit))
// pushing entities concurrently.
for _, e := range entities {
e := e // suppress loop variable
go func() {
require.True(t, q.Push(e.Identifier, e))
pushWG.Done()
Expand Down
1 change: 0 additions & 1 deletion module/mempool/queue/heroStore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func TestHeroStore_Concurrent(t *testing.T) {
messages := unittest.EngineMessageFixtures(sizeLimit)
// putting messages concurrently.
for _, m := range messages {
m := m
go func() {
require.True(t, store.Put(m))
putWG.Done()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func MockBlobService(bs blockstore.Blockstore) *mocknetwork.BlobService {
wg.Add(len(cids))

for _, c := range cids {
c := c
go func() {
defer wg.Done()

Expand Down
1 change: 0 additions & 1 deletion module/trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func BenchmarkStartBlockSpan(b *testing.B) {
{name: "cacheHit", n: 100},
{name: "cacheMiss", n: 100000},
} {
t := t
b.Run(t.name, func(b *testing.B) {
randomIDs := make([]flow.Identifier, 0, t.n)
for i := 0; i < t.n; i++ {
Expand Down
2 changes: 0 additions & 2 deletions module/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ func TestMergeChannels(t *testing.T) {
channels := []chan int{make(chan int), make(chan int), make(chan int)}
merged := util.MergeChannels(channels).(<-chan int)
for i, ch := range channels {
i := i
ch := ch
go func() {
ch <- i
close(ch)
Expand Down
7 changes: 0 additions & 7 deletions network/alsp/internal/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ func TestSpamRecordCache_ConcurrentInitAndRemove(t *testing.T) {

// initialize spam records concurrently
for _, originID := range originIDsToAdd {
originID := originID // capture range variable
go func() {
defer wg.Done()
penalty, err := cache.AdjustWithInit(originID, adjustFnNoOp)
Expand Down Expand Up @@ -612,7 +611,6 @@ func TestSpamRecordCache_ConcurrentInitRemoveAdjust(t *testing.T) {

// Initialize spam records concurrently
for _, originID := range originIDsToAdd {
originID := originID // capture range variable
go func() {
defer wg.Done()
penalty, err := cache.AdjustWithInit(originID, adjustFnNoOp)
Expand Down Expand Up @@ -684,7 +682,6 @@ func TestSpamRecordCache_ConcurrentInitRemoveAndAdjust(t *testing.T) {

// initialize spam records concurrently
for _, originID := range originIDsToAdd {
originID := originID
go func() {
defer wg.Done()
penalty, err := cache.AdjustWithInit(originID, adjustFnNoOp)
Expand All @@ -695,7 +692,6 @@ func TestSpamRecordCache_ConcurrentInitRemoveAndAdjust(t *testing.T) {

// remove spam records concurrently
for _, originID := range originIDsToRemove {
originID := originID
go func() {
defer wg.Done()
cache.Remove(originID)
Expand All @@ -704,7 +700,6 @@ func TestSpamRecordCache_ConcurrentInitRemoveAndAdjust(t *testing.T) {

// adjust spam records concurrently
for _, originID := range originIDsToAdjust {
originID := originID
go func() {
defer wg.Done()
_, err := cache.AdjustWithInit(originID, func(record *model.ProtocolSpamRecord) (*model.ProtocolSpamRecord, error) {
Expand Down Expand Up @@ -773,7 +768,6 @@ func TestSpamRecordCache_ConcurrentIdentitiesAndOperations(t *testing.T) {

// initialize spam records concurrently
for _, originID := range originIDsToAdd {
originID := originID
go func() {
defer wg.Done()
penalty, err := cache.AdjustWithInit(originID, adjustFnNoOp)
Expand All @@ -787,7 +781,6 @@ func TestSpamRecordCache_ConcurrentIdentitiesAndOperations(t *testing.T) {

// remove spam records concurrently
for _, originID := range originIDsToRemove {
originID := originID
go func() {
defer wg.Done()
require.True(t, cache.Remove(originID))
Expand Down
1 change: 0 additions & 1 deletion network/p2p/scoring/internal/subscriptionCache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ func TestSubscriptionCache_ConcurrentUpdate(t *testing.T) {
// verify that all peers have all topics; concurrently
allTopicsVerified := sync.WaitGroup{}
for _, pid := range peerIds {
pid := pid
allTopicsVerified.Add(1)
go func() {
defer allTopicsVerified.Done()
Expand Down
1 change: 0 additions & 1 deletion network/p2p/test/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ func EnsureNoPubsubMessageExchange(t *testing.T,

wg := &sync.WaitGroup{}
for _, node := range from {
node := node // capture range variable
for i := 0; i < count; i++ {
wg.Add(1)
go func() {
Expand Down
1 change: 0 additions & 1 deletion network/p2p/tracer/internal/rpc_sent_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestRPCSentTracker_IHave(t *testing.T) {
}
iHaves := make([]*pb.ControlIHave, len(testCases))
for i, testCase := range testCases {
testCase := testCase
iHaves[i] = &pb.ControlIHave{
MessageIDs: testCase.messageIDS,
}
Expand Down