-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 TestGoroutineLeak and Example_subscribe test #1123
Conversation
Both the test use subscription and there was a race condition which would cause the builds to fail at times. This commit fixes it.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)
db_test.go, line 1595 at r1 (raw file):
}() // Wait for the go routine to be scheduled. time.Sleep(time.Second)
We changed to wait group for a certainity.
Is there any reason for changing from wait group from sleep
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @balajijinnah and @manishrjain)
db_test.go, line 1595 at r1 (raw file):
Previously, balajijinnah (balaji) wrote…
We changed to wait group for a certainity.
Is there any reason for changing from wait group from sleep
The wait group doesn't ensure that the subscriber is ready. The tests would fail because the subscriber would not receive the update.
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.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)
Both the test use subscription API and there was a race condition that would cause the builds to fail at times. This commit fixes it. (cherry picked from commit ffb3450)
Both the test use subscription and there was a race condition which
would cause the builds to fail at times. This commit fixes it.
Fixes #1122 and #1087
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)