Skip to content

Commit

Permalink
Merge pull request #18126 from siyuanfoundation/robust2
Browse files Browse the repository at this point in the history
test: update CouldSetSnapshotCatchupEntries to use 3.5.14.
  • Loading branch information
jmhbnz authored Jun 5, 2024
2 parents a0aee63 + 06f2746 commit 179a09e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions tests/e2e/etcd_mix_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ func mixVersionsSnapshotTestByMockPartition(t *testing.T, cfg *e2e.EtcdProcessCl
t.Skipf("%q does not exist", e2e.BinPath.EtcdLastRelease)
}

clusterOptions := []e2e.EPClusterOption{e2e.WithConfig(cfg), e2e.WithSnapshotCount(10)}
// TODO: remove version check after 3.5.14 release.
if cfg.Version == e2e.CurrentVersion {
clusterOptions = append(clusterOptions, e2e.WithSnapshotCatchUpEntries(10))
clusterOptions := []e2e.EPClusterOption{
e2e.WithConfig(cfg),
e2e.WithSnapshotCount(10),
e2e.WithSnapshotCatchUpEntries(10),
}
t.Logf("Create an etcd cluster with %d member", cfg.ClusterSize)
epc, err := e2e.NewEtcdProcessCluster(context.TODO(), t, clusterOptions...)
Expand Down Expand Up @@ -162,10 +162,8 @@ func mixVersionsSnapshotTestByMockPartition(t *testing.T, cfg *e2e.EtcdProcessCl
assertKVHash(t, epc)

leaderEPC = epc.Procs[epc.WaitLeader(t)]
if cfg.Version == e2e.CurrentVersion {
t.Log("Verify logs to check snapshot be sent from leader to follower")
e2e.AssertProcessLogs(t, leaderEPC, "sent database snapshot")
}
t.Log("Verify logs to check snapshot be sent from leader to follower")
e2e.AssertProcessLogs(t, leaderEPC, "sent database snapshot")
}

func writeKVs(t *testing.T, etcdctl *e2e.EtcdctlV3, startIdx, endIdx int) {
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/e2e/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

func TestEtcdServerProcessConfig(t *testing.T) {
v3_5_12 := semver.Version{Major: 3, Minor: 5, Patch: 12}
v3_5_13 := semver.Version{Major: 3, Minor: 5, Patch: 13}
v3_5_14 := semver.Version{Major: 3, Minor: 5, Patch: 14}
tcs := []struct {
name string
config *EtcdProcessClusterConfig
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestEtcdServerProcessConfig(t *testing.T) {
expectArgsContain: []string{
"--experimental-snapshot-catchup-entries=100",
},
mockBinaryVersion: &v3_5_13,
mockBinaryVersion: &v3_5_14,
},
{
name: "CatchUpEntriesNoVersion",
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/e2e/etcd_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,6 @@ func CouldSetSnapshotCatchupEntries(execPath string) bool {
return false
}
// snapshot-catchup-entries flag was backported in https://github.com/etcd-io/etcd/pull/17808
v3_5_13 := semver.Version{Major: 3, Minor: 5, Patch: 13}
return v.Compare(v3_5_13) >= 0
v3_5_14 := semver.Version{Major: 3, Minor: 5, Patch: 14}
return v.Compare(v3_5_14) >= 0
}

0 comments on commit 179a09e

Please sign in to comment.