Skip to content

Commit

Permalink
fix embedded storage error when use empty testing.T
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Feb 3, 2023
1 parent a9bba97 commit d615e8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions store/etcdv3/embedded/embeded.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package embedded

import (
"flag"
"os"
"testing"

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

0 comments on commit d615e8c

Please sign in to comment.