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

rpc: fix TestHeartbeatHealth #27408

Merged
merged 1 commit into from
Jul 11, 2018
Merged

Conversation

m-schneider
Copy link
Contributor

This test was sending strings to ConnHealth not of the form host:port,
which was being validated asynchronously and sometimes caused that
validation error to be recieved before an ErrNotHeartbeated error. Now we'll use
addresses of the correct form, so we should always receive the ErrNotHeartbeated
error.

Close #27340

Release note: None

@m-schneider m-schneider requested review from bdarnell and a team July 11, 2018 18:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@bdarnell bdarnell 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: :shipit: complete! 0 of 0 LGTMs obtained


pkg/rpc/context_test.go, line 213 at r1 (raw file):

		t.Fatal(err)
	}
	lisLocalServer, err := net.Listen("tcp", "127.0.0.2:0")

Does it matter that the IP addresses are different here? You should be able to start two local listeners on 127.0.0.1:0, which will get two different ports assigned by the kernel.


pkg/rpc/context_test.go, line 286 at r1 (raw file):

		t.Error(err)
	}
	lisLocalServer.Close()

Do these in a defer after each listener is created.

Copy link
Contributor Author

@m-schneider m-schneider 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: :shipit: complete! 0 of 0 LGTMs obtained


pkg/rpc/context_test.go, line 213 at r1 (raw file):

Previously, bdarnell (Ben Darnell) wrote…

Does it matter that the IP addresses are different here? You should be able to start two local listeners on 127.0.0.1:0, which will get two different ports assigned by the kernel.

You're absolutely right!


pkg/rpc/context_test.go, line 286 at r1 (raw file):

Previously, bdarnell (Ben Darnell) wrote…

Do these in a defer after each listener is created.

Done.

This test was sending strings to ConnHealth not of the form host:port,
which was being validated asynchronously and sometimes caused that
validation error to be recieved before an ErrNotHeartbeated error. Now we'll use
addresses of the correct form, so we should always receive the ErrNotHeartbeated
error.

Close cockroachdb#27340

Release note: None
@m-schneider
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Jul 11, 2018
27408: rpc: fix TestHeartbeatHealth r=m-schneider a=m-schneider

This test was sending strings to ConnHealth not of the form host:port,
which was being validated asynchronously and sometimes caused that
validation error to be recieved before an ErrNotHeartbeated error. Now we'll use
addresses of the correct form, so we should always receive the ErrNotHeartbeated
error.

Close #27340

Release note: None

Co-authored-by: Masha Schneider <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 11, 2018

Build succeeded

@craig craig bot merged commit a81ab46 into cockroachdb:master Jul 11, 2018
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