-
Notifications
You must be signed in to change notification settings - Fork 719
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
*: use unix socket in test #266
Conversation
return port | ||
// unixURL returns a unique unix socket url, used for test only. | ||
func unixURL() string { | ||
return fmt.Sprintf("unix://localhost:%d.%d.sock", os.Getpid(), atomic.AddUint64(&unixURLCount, 1)) |
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.
we will use a unix socket file outer, how do we clear 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.
On my machine, they are deleted automaticly after tests. I will do more tests on other machines.
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.
You should also test if test failed whether these can be deleted automatically.
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.
On my machine, they will be deleted automatically even if tests failed, however if we Interrupt tests, they will not be deleted.
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.
got it, so no need to delete manually.
Etcd cluster will not initialize successfully with unix socket in go1.5. I am digging into this problem. In go1.5, etcd is blocked at https://github.com/coreos/etcd/blob/master/pkg/transport/transport.go#L70. |
Seem that we meet block in CI test, we can pass a timeout to |
LGTM |
@@ -128,7 +152,9 @@ func (s *testMemberAPISuite) TestMemberList(c *C) { | |||
defer clean() | |||
|
|||
parts := []string{cfgs[rand.Intn(len(cfgs))].ClientUrls, apiPrefix, "/api/v1/members"} | |||
resp, err := s.hc.Get(strings.Join(parts, "")) | |||
addr, err := unixAddrToHTTPAddr(strings.Join(parts, "")) |
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.
I think it's better to modify ClientUrls
in mustNewCluster
, instead of converting it everywhere.
LGTM |
#221