Skip to content

Commit

Permalink
repro 17052
Browse files Browse the repository at this point in the history
Signed-off-by: ZhouJianMS <[email protected]>
  • Loading branch information
ZhouJianMS committed Dec 12, 2023
1 parent 5db9f78 commit 595b7a2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/e2e/ctl_v3_member_no_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ import (
"go.etcd.io/etcd/tests/v3/framework/testutils"
)

func TestMemberReplaceMultiple(t *testing.T) {
for i := 0; i < 100; i++ {
t.Run("", func(t *testing.T) {
TestMemberReplace(t)
})
}
}
func TestMemberReplace(t *testing.T) {
e2e.BeforeTest(t)
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
Expand Down Expand Up @@ -77,14 +84,19 @@ func TestMemberReplace(t *testing.T) {

t.Logf("Adding member %s back", memberName)
removedMemberPeerUrl := member.Config().PeerURL.String()
_, err = cc.MemberAdd(ctx, memberName, []string{removedMemberPeerUrl})
require.NoError(t, err)
for {
_, err = cc.MemberAdd(ctx, memberName, []string{removedMemberPeerUrl})
if err == nil {
break
}
t.Logf("Adding member %s back failed: %v", memberName, err)
}
err = patchArgs(member.Config().Args, "initial-cluster-state", "existing")
require.NoError(t, err)

t.Logf("Starting member %s", memberName)
err = member.Start(ctx)
require.NoError(t, err)
require.NoError(t, err, "failed to start member, %v", err)
testutils.ExecuteUntil(ctx, t, func() {
for {
_, found, err := getMemberIdByName(ctx, c, memberName)
Expand Down

0 comments on commit 595b7a2

Please sign in to comment.