Skip to content

Commit

Permalink
fixup! sever: v2store deprecation: Fix etcdctl snapshot restore to …
Browse files Browse the repository at this point in the history
…restore correct 'backend' (bbolt) context in aspect of membership.
  • Loading branch information
ptabor committed Apr 22, 2021
1 parent 388279a commit e1ffa9a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/etcdserver/api/membership/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ import (
"github.com/coreos/go-semver/semver"
"github.com/stretchr/testify/assert"
"go.etcd.io/etcd/client/pkg/v3/types"
betesting "go.etcd.io/etcd/server/v3/mvcc/backend/testing"

"go.etcd.io/etcd/server/v3/mvcc/backend"
"go.uber.org/zap"
)

func TestAddRemoveMember(t *testing.T) {
c := newTestCluster(t, nil)
be, bepath := backend.NewDefaultTmpBackend(t)
be, bepath := betesting.NewDefaultTmpBackend(t)
c.SetBackend(be)
c.AddMember(newTestMember(17, nil, "node17", nil))
c.RemoveMember(17)
c.AddMember(newTestMember(18, nil, "node18", nil))
c.AddMember(newTestMember(17, nil, "node17", nil), true)
c.RemoveMember(17, true)
c.AddMember(newTestMember(18, nil, "node18", nil), true)

// Skipping removal of already removed member
c.RemoveMember(17)
c.RemoveMember(17, true)
err := be.Close()
assert.NoError(t, err)

be2 := backend.NewDefaultBackend(bepath)
defer func() {
err := be2.Close()
assert.NoError(t, err)
assert.NoError(t, be2.Close())
}()

if false {
Expand Down

0 comments on commit e1ffa9a

Please sign in to comment.