mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests: fix failed integration test cases after enabling --strict-reconfig-check
by default
Signed-off-by: Clark <fwyongxing@gmail.com>
This commit is contained in:
parent
3beb25489d
commit
3f3149b15f
@ -122,9 +122,9 @@ func dialWithSchemeTest(cx ctlCtx) {
|
||||
}
|
||||
|
||||
type ctlCtx struct {
|
||||
t *testing.T
|
||||
apiPrefix string
|
||||
cfg e2e.EtcdProcessClusterConfig
|
||||
t *testing.T
|
||||
apiPrefix string
|
||||
cfg e2e.EtcdProcessClusterConfig
|
||||
|
||||
corruptFunc func(string) error
|
||||
disableStrictReconfigCheck bool
|
||||
|
@ -48,7 +48,7 @@ func TestMemberList(t *testing.T) {
|
||||
func TestMemberAdd(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
capi := clus.RandClient()
|
||||
@ -67,7 +67,7 @@ func TestMemberAdd(t *testing.T) {
|
||||
func TestMemberAddWithExistingURLs(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
capi := clus.RandClient()
|
||||
@ -91,7 +91,7 @@ func TestMemberAddWithExistingURLs(t *testing.T) {
|
||||
func TestMemberRemove(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
capi := clus.Client(1)
|
||||
@ -190,7 +190,7 @@ func TestMemberAddUpdateWrongURLs(t *testing.T) {
|
||||
func TestMemberAddForLearner(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
capi := clus.RandClient()
|
||||
@ -219,7 +219,7 @@ func TestMemberAddForLearner(t *testing.T) {
|
||||
func TestMemberPromote(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
// member promote request can be sent to any server in cluster,
|
||||
@ -382,7 +382,7 @@ func TestMaxLearnerInCluster(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
// 1. start with a cluster with 3 voting member and max learner 2
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, ExperimentalMaxLearners: 2})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, ExperimentalMaxLearners: 2, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
// 2. adding 2 learner members should succeed
|
||||
|
@ -33,7 +33,8 @@ const (
|
||||
var lazyCluster = integration.NewLazyClusterWithConfig(
|
||||
integration2.ClusterConfig{
|
||||
Size: 3,
|
||||
WatchProgressNotifyInterval: 200 * time.Millisecond})
|
||||
WatchProgressNotifyInterval: 200 * time.Millisecond,
|
||||
DisableStrictReconfigCheck: true})
|
||||
|
||||
func exampleEndpoints() []string { return lazyCluster.EndpointsV3() }
|
||||
|
||||
|
@ -776,7 +776,7 @@ func TestKVLargeRequests(t *testing.T) {
|
||||
func TestKVForLearner(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
// we have to add and launch learner member after initial cluster was created, because
|
||||
@ -855,7 +855,7 @@ func TestKVForLearner(t *testing.T) {
|
||||
func TestBalancerSupportLearner(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3})
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
// we have to add and launch learner member after initial cluster was created, because
|
||||
|
@ -72,7 +72,7 @@ func TestDoubleClusterSizeOf3(t *testing.T) { testDoubleClusterSize(t, 3) }
|
||||
|
||||
func testDoubleClusterSize(t *testing.T, size int) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: size})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: size, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
for i := 0; i < size; i++ {
|
||||
@ -83,7 +83,12 @@ func testDoubleClusterSize(t *testing.T, size int) {
|
||||
|
||||
func TestDoubleTLSClusterSizeOf3(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 1, PeerTLS: &integration.TestTLSInfo})
|
||||
cfg := &integration.ClusterConfig{
|
||||
Size: 1,
|
||||
PeerTLS: &integration.TestTLSInfo,
|
||||
DisableStrictReconfigCheck: true,
|
||||
}
|
||||
c := integration.NewCluster(t, cfg)
|
||||
defer c.Terminate(t)
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
@ -97,7 +102,7 @@ func TestDecreaseClusterSizeOf5(t *testing.T) { testDecreaseClusterSize(t, 5) }
|
||||
|
||||
func testDecreaseClusterSize(t *testing.T, size int) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: size})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: size, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
// TODO: remove the last but one member
|
||||
@ -175,7 +180,7 @@ func TestForceNewCluster(t *testing.T) {
|
||||
|
||||
func TestAddMemberAfterClusterFullRotation(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
// remove all the previous three members and add in three new members.
|
||||
@ -198,7 +203,7 @@ func TestAddMemberAfterClusterFullRotation(t *testing.T) {
|
||||
// Ensure we can remove a member then add a new one back immediately.
|
||||
func TestIssue2681(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 5})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 5, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
if err := c.RemoveMember(t, c.Members[0].Client, uint64(c.Members[4].Server.MemberId())); err != nil {
|
||||
@ -219,7 +224,7 @@ func TestIssue2746WithThree(t *testing.T) { testIssue2746(t, 3) }
|
||||
|
||||
func testIssue2746(t *testing.T, members int) {
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: members, SnapshotCount: 10})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: members, SnapshotCount: 10, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
// force a snapshot
|
||||
@ -241,7 +246,7 @@ func testIssue2746(t *testing.T, members int) {
|
||||
func TestIssue2904(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
// start 1-member Cluster to ensure member 0 is the leader of the Cluster.
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 2, UseBridge: true})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 2, UseBridge: true, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
c.WaitLeader(t)
|
||||
|
||||
@ -276,7 +281,7 @@ func TestIssue2904(t *testing.T) {
|
||||
func TestIssue3699(t *testing.T) {
|
||||
// start a Cluster of 3 nodes a, b, c
|
||||
integration.BeforeTest(t)
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, UseBridge: true})
|
||||
c := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, UseBridge: true, DisableStrictReconfigCheck: true})
|
||||
defer c.Terminate(t)
|
||||
|
||||
// make node a unavailable
|
||||
|
@ -261,10 +261,11 @@ func TestV3CorruptAlarmWithLeaseCorrupted(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
lg := zaptest.NewLogger(t)
|
||||
clus := integration.NewCluster(t, &integration.ClusterConfig{
|
||||
CorruptCheckTime: time.Second,
|
||||
Size: 3,
|
||||
SnapshotCount: 10,
|
||||
SnapshotCatchUpEntries: 5,
|
||||
CorruptCheckTime: time.Second,
|
||||
Size: 3,
|
||||
SnapshotCount: 10,
|
||||
SnapshotCatchUpEntries: 5,
|
||||
DisableStrictReconfigCheck: true,
|
||||
})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
|
@ -120,7 +120,7 @@ func TestMoveLeaderError(t *testing.T) {
|
||||
func TestMoveLeaderToLearnerError(t *testing.T) {
|
||||
integration.BeforeTest(t)
|
||||
|
||||
clus := integration.NewCluster(t, &integration.ClusterConfig{Size: 3})
|
||||
clus := integration.NewCluster(t, &integration.ClusterConfig{Size: 3, DisableStrictReconfigCheck: true})
|
||||
defer clus.Terminate(t)
|
||||
|
||||
// we have to add and launch learner member after initial cluster was created, because
|
||||
|
Loading…
x
Reference in New Issue
Block a user