Skip to content

Commit d615e8c

Browse files
committed
fix embedded storage error when use empty testing.T
1 parent a9bba97 commit d615e8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

store/etcdv3/embedded/embeded.go

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package embedded
22

33
import (
4+
"flag"
5+
"os"
46
"testing"
57

68
"go.etcd.io/etcd/client/v3/namespace"
@@ -13,6 +15,9 @@ var clusters map[string]*integration.ClusterV3 = map[string]*integration.Cluster
1315
func NewCluster(t *testing.T, prefix string) *integration.ClusterV3 {
1416
cluster := clusters[t.Name()]
1517
if cluster == nil {
18+
os.Args = []string{"test.short=false"}
19+
testing.Init()
20+
flag.Parse()
1621
integration.BeforeTestExternal(t)
1722
cluster = integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1})
1823
t.Cleanup(func() {

0 commit comments

Comments
 (0)