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

*: use unix socket in test #266

Merged
merged 3 commits into from
Aug 16, 2016
Merged

*: use unix socket in test #266

merged 3 commits into from
Aug 16, 2016

Conversation

overvenus
Copy link
Member

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))
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@qiuyesuifeng qiuyesuifeng Aug 10, 2016

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@overvenus
Copy link
Member Author

overvenus commented Aug 10, 2016

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. RoundTrip() is a function defined in go standard library, the same code works fine in go 1.6 and go 1.7, so I think it is time to move on, replace go 1.5 with go 1.7

@overvenus overvenus changed the title *: use unix socket in test [WIP]*: use unix socket in test Aug 10, 2016
@siddontang
Copy link
Contributor

Seem that we meet block in CI test, we can pass a timeout to go test like go test -timeout 5m, so if the test blocks longer than 5m, panic, so we can see wether case causes this.

@overvenus overvenus changed the title [WIP]*: use unix socket in test *: use unix socket in test Aug 16, 2016
@siddontang
Copy link
Contributor

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, ""))
Copy link
Contributor

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.

@huachaohuang
Copy link
Contributor

LGTM

@overvenus overvenus merged commit 04de710 into tikv:master Aug 16, 2016
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.

4 participants