Skip to content

Commit a541745

Browse files
authored
Fix TestVersionupgradeAndRespectToLatest8x test (#7283) (#7286)
* Fix TestVersionupgradeAndRespectToLatest8x by using 2 replicas in 8.7x => 8.9.0 --------- Signed-off-by: Michael Montgomery <[email protected]> (cherry picked from commit 7a1bb9c)
1 parent ef47e51 commit a541745

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/e2e/kb/version_upgrade_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"sigs.k8s.io/controller-runtime/pkg/client"
1515

1616
commonv1 "github.com/elastic/cloud-on-k8s/v2/pkg/apis/common/v1"
17+
"github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/version"
1718
"github.com/elastic/cloud-on-k8s/v2/pkg/controller/elasticsearch/reconcile"
1819
kibana2 "github.com/elastic/cloud-on-k8s/v2/pkg/controller/kibana"
1920
"github.com/elastic/cloud-on-k8s/v2/test/e2e/test"
@@ -175,20 +176,19 @@ func TestVersionUpgradeToLatest8x(t *testing.T) {
175176
}
176177

177178
func TestVersionUpgradeAndRespecToLatest8x(t *testing.T) {
178-
// Skip for 8.10.0-SNAPSHOT because after a few seconds, ES is yellow because of unassigned
179-
// fleet-files-agent-000001 and fleet-file-data-agent-000001 shards.
180-
// TODO: remove once https://github.com/elastic/cloud-on-k8s/issues/7013 is resolved
181-
if test.Ctx().ElasticStackVersion == "8.10.0-SNAPSHOT" {
182-
t.SkipNow()
183-
}
184-
185179
srcVersion, dstVersion := test.GetUpgradePathTo8x(test.Ctx().ElasticStackVersion)
186180

187181
test.SkipInvalidUpgrade(t, srcVersion, dstVersion)
188182

189183
name := "test-upgrade-and-respec-to-8x"
184+
esNodes := 1
185+
// https://github.com/elastic/cloud-on-k8s/issues/7013
186+
// Between 8.7 and 8.9 fleet indices are set with a replica which fails with a single node. In 8.10 indices were moved to datastreams.
187+
if version.MustParse(test.Ctx().ElasticStackVersion).GTE(version.MinFor(8, 7, 0)) && version.MustParse(test.Ctx().ElasticStackVersion).LT(version.MinFor(8, 10, 0)) {
188+
esNodes = 2
189+
}
190190
esBuilder := elasticsearch.NewBuilder(name).
191-
WithESMasterDataNodes(1, elasticsearch.DefaultResources).
191+
WithESMasterDataNodes(esNodes, elasticsearch.DefaultResources).
192192
WithVersion(dstVersion)
193193

194194
srcNodeCount := 3

0 commit comments

Comments
 (0)