-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add master server unit test #3086
Add master server unit test #3086
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.
LGTM++!
Some minor comments.
Btw, CI reports:
[03:54:01] make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
[03:54:01] make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
[03:54:04] [ERROR] [mFailed to install: Unable to get repository
[03:54:04] Unable to get repository
[03:54:04] Unable to get repository
[03:54:04] CMakeFiles/go_vendor.dir/build.make:60: recipe for target 'glide' failed
[03:54:04] CMakeFiles/Makefile2:432: recipe for target 'CMakeFiles/go_vendor.dir/all' failed
[03:54:04] make[2]: *** [glide] Error 1
[03:54:04] make[1]: *** [CMakeFiles/go_vendor.dir/all] Error 2
[03:54:04] make[1]: *** Waiting for unfinished jobs....
[03:54:07] Note: checking out '9f75c5aa851cd877fb0d93ccc31b8567a6706546'.
go/master/service_test.go
Outdated
log.Fatal(err) | ||
} | ||
defer func() { | ||
e.Close() |
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.
Need to handle error, otherwise gometalinter check would not pass.
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.
It seems that Close() function return nothing.
go/master/service_test.go
Outdated
defer func() { | ||
e.Close() | ||
if err := os.RemoveAll(etcdDir); err != nil { | ||
log.Fatal(err) |
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.
Could use t.Fatal(err)
here.
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.
Done.
go/master/service_test.go
Outdated
}() | ||
select { | ||
case <-e.Server.ReadyNotify(): | ||
log.Printf("Server is ready!") |
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.
Maybe t.Log
would be better (prints only when test failed or -v
is specified). Same for other places.
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.
Done.
CI failed because the develop branch is not building. Please rebase / pull new develop, it contains the fix. |
Thanks @helinwang , fixed the CI failed. |
Fixed #3079