mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #15632 from serathius/fix-comparing-etcd-version
tests: Fix comparing etcd version
This commit is contained in:
commit
138fae6246
@ -364,7 +364,15 @@ func GetVersionFromBinary(binaryPath string) (*semver.Version, error) {
|
|||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
if strings.HasPrefix(line, "etcd Version:") {
|
if strings.HasPrefix(line, "etcd Version:") {
|
||||||
versionString := strings.TrimSpace(strings.SplitAfter(line, ":")[1])
|
versionString := strings.TrimSpace(strings.SplitAfter(line, ":")[1])
|
||||||
return semver.NewVersion(versionString)
|
version, err := semver.NewVersion(versionString)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &semver.Version{
|
||||||
|
Major: version.Major,
|
||||||
|
Minor: version.Minor,
|
||||||
|
Patch: version.Patch,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ func TestRobustness(t *testing.T) {
|
|||||||
e2e.WithPeerProxy(true),
|
e2e.WithPeerProxy(true),
|
||||||
e2e.WithIsPeerTLS(true),
|
e2e.WithIsPeerTLS(true),
|
||||||
}
|
}
|
||||||
if !v.LessThan(version.V3_6) {
|
if v.Compare(version.V3_6) >= 0 {
|
||||||
snapshotOptions = append(snapshotOptions, e2e.WithSnapshotCatchUpEntries(100))
|
snapshotOptions = append(snapshotOptions, e2e.WithSnapshotCatchUpEntries(100))
|
||||||
}
|
}
|
||||||
scenarios = append(scenarios, scenario{
|
scenarios = append(scenarios, scenario{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user