From 34550c5b17124ddc59458ef774f6b43a086522e3 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Fri, 2 Jul 2021 18:55:58 -0400 Subject: [PATCH] [BUG] Fix cat.health test failures in pre 1.0.0 mixed cluster test (#928) (#935) Fixes the cat.health yaml failures when running in a bwc mixed cluster with legacy (pre 1.0.0) nodes. Signed-off-by: Nicholas Walter Knize --- .../rest-api-spec/test/cat.health/10_basic.yml | 11 +++++++++-- .../transport/AbstractSimpleTransportTestCase.java | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.health/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.health/10_basic.yml index 6c206d222ac5d..731fc5d166eca 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.health/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.health/10_basic.yml @@ -1,5 +1,8 @@ --- "Help": + - skip: + version: " - 7.10.99" + reason: "discovered_master added in OpenSearch 1.0.0" - do: cat.health: help: true @@ -27,7 +30,9 @@ --- "Empty cluster": - + - skip: + version: " - 7.10.99" + reason: "discovered_master added in OpenSearch 1.0.0" - do: cat.health: {} @@ -56,7 +61,9 @@ --- "With ts parameter": - + - skip: + version: " - 7.10.99" + reason: "discovered_master added in OpenSearch 1.0.0" - do: cat.health: ts: false diff --git a/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java b/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java index 713fb545746ef..d55754e30fa0c 100644 --- a/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java +++ b/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java @@ -2013,7 +2013,8 @@ public void testHandshakeUpdatesVersion() throws IOException { TransportRequestOptions.Type.REG, TransportRequestOptions.Type.STATE); try (Transport.Connection connection = serviceA.openConnection(node, builder.build())) { - assertEquals(connection.getVersion(), version); + // OpenSearch 1.0+ in bwc mode should only "upgrade" to Legacy v7.10.2 + assertEquals(connection.getVersion(), version.onOrAfter(Version.V_1_0_0) ? LegacyESVersion.V_7_10_2 : version); } } }