-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
rpc: fix TestHeartbeatHealth #27408
Conversation
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: 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.
0242ad2
to
45fd355
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.
Reviewable status: 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
45fd355
to
a81ab46
Compare
bors r+ |
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]>
Build succeeded |
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