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

fix: race condition in tests #38

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

krzysztofdrys
Copy link
Collaborator

No description provided.

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`
Copy link
Collaborator

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

Copy link
Collaborator Author

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Explained in comment

@krzysztofdrys krzysztofdrys force-pushed the feat/fix-race-condition-in-tests branch from 808b2ad to 5be1ef5 Compare April 2, 2024 14:18
@krzysztofdrys krzysztofdrys merged commit 7f7ea06 into main Apr 4, 2024
1 check passed
@hamiamiri6
Copy link

7f7ea06

Copy link

@hamiamiri6 hamiamiri6 left a comment

Choose a reason for hiding this comment

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

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.

3 participants