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 TestGoroutineLeak and Example_subscribe test #1123

Merged
merged 1 commit into from
Nov 20, 2019

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Nov 18, 2019

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

Both the test use subscription and there was a race condition which
would cause the builds to fail at times. This commit fixes it.
@coveralls
Copy link

coveralls commented Nov 18, 2019

Coverage Status

Coverage increased (+0.04%) to 77.421% when pulling 76d460b on ibrahim/fix-testgoroutineleak into eef7c12 on master.

Copy link
Contributor

@poonai poonai left a 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

Copy link
Contributor

@ashish-goswami ashish-goswami left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)

Copy link
Contributor Author

@jarifibrahim jarifibrahim left a 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.

Copy link
Contributor

@poonai poonai left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain)

@jarifibrahim jarifibrahim merged commit ffb3450 into master Nov 20, 2019
@jarifibrahim jarifibrahim deleted the ibrahim/fix-testgoroutineleak branch November 20, 2019 12:59
jarifibrahim pushed a commit that referenced this pull request Mar 12, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

TestGoroutineLeak test is flaky
4 participants