Skip to content

Commit cd25874

Browse files
committed
revised testing etcd generator
1 parent af8cd60 commit cd25874

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

store/etcdv3/embedded/embeded.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ var clusters map[string]*integration.ClusterV3 = map[string]*integration.Cluster
1111

1212
// NewCluster new a embedded cluster
1313
func NewCluster(t *testing.T, prefix string) *integration.ClusterV3 {
14-
c, ok := clusters[t.Name()]
15-
if !ok {
14+
cluster := clusters[t.Name()]
15+
if cluster == nil {
1616
integration.BeforeTestExternal(t)
17-
cluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1})
17+
cluster = integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1})
1818
t.Cleanup(func() {
1919
cluster.Terminate(t)
2020
delete(clusters, t.Name())
@@ -24,7 +24,6 @@ func NewCluster(t *testing.T, prefix string) *integration.ClusterV3 {
2424
cliv3.Watcher = namespace.NewWatcher(cliv3.Watcher, prefix)
2525
cliv3.Lease = namespace.NewLease(cliv3.Lease, prefix)
2626
clusters[t.Name()] = cluster
27-
return cluster
2827
}
29-
return c
28+
return cluster
3029
}

0 commit comments

Comments
 (0)