main_test: skip test when invoked via go test
@@ -26,7 +26,10 @@ func TestMain(t *testing.T) {
// don't launch etcd server when invoked via go test
// Note: module name has /v3 now
if strings.HasSuffix(os.Args[0], "v3.test") {
- return
+ t.Skip("skip launching etcd server when invoked via go test")
+ }
+ if len(os.Args) > 1 && strings.HasPrefix(os.Args[1], "-test.") {
+ t.Skip("skip launching etcd server when invoked via go test")
}
notifier := make(chan os.Signal, 1)
