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 8701692
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/creack/pty v1.1.18 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03V
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
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 8701692

Please sign in to comment.