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

TestConcurrentCodec remove race errors #251

Merged
merged 3 commits into from
May 8, 2021
Merged

TestConcurrentCodec remove race errors #251

merged 3 commits into from
May 8, 2021

Conversation

Sriep
Copy link
Contributor

@Sriep Sriep commented May 7, 2021

TestConcurrentCodec reworked to remove race errors. Aims to simulate the way block.Block works with ToMsgpack.

@Sriep Sriep requested a review from platsko May 7, 2021 15:48
@Sriep Sriep linked an issue May 7, 2021 that may be closed by this pull request
code/go/0chain.net/core/common/codec_test.go Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Outdated Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Outdated Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Outdated Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Outdated Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Outdated Show resolved Hide resolved
code/go/0chain.net/core/common/codec_test.go Show resolved Hide resolved
@Sriep Sriep merged commit cec3177 into master May 8, 2021
@Sriep Sriep deleted the ut-codec branch May 8, 2021 11:40
wg.Done()
}()
}(i, &wg)
Copy link
Contributor

@platsko platsko May 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't figure out what is the reason for passing waitgroup to goroutine as an argument?
Isn't such need in this case. This will allocates memory on the heap (run to heap) and appends work for the garbage collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate ToMsgpack for race issues.
2 participants