-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix: race condition in tests #38
Conversation
Makefile
Outdated
go test -race -count=1 `go list ./... | grep -v e2e-tests` | ||
|
||
.PHONY: unit-tests-ci | ||
unit-tests-ci: ## run unit tests without e2e-tests directory (multiple times to find race conditions). | ||
go test -race -count=50 `go list ./... | grep -v e2e-tests` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can pass failfast flag also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -54,10 +54,11 @@ func TestCreateRemoveConcurrently(t *testing.T) { | |||
hubs := &sync.Map{} | |||
|
|||
wg := sync.WaitGroup{} | |||
wg.Add(channelsNo * clientsPerChannel) | |||
wg.Add(channelsNo*clientsPerChannel + channelsNo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caan you explain why this logic? Preferably in comment in code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained in comment
808b2ad
to
5be1ef5
Compare
5be1ef5
to
fab72d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.