Skip to content

Commit

Permalink
Enable bwc tests after elastic#67414 merge (elastic#67430)
Browse files Browse the repository at this point in the history
  • Loading branch information
astefan authored Jan 13, 2021
1 parent d7761bf commit b3adf2b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/67414" /* place a PR link here when committing bwc changes */
boolean bwc_tests_enabled = true
String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
/*
* FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a
* JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ public void testCcsMinimizeRoundtripsIsFalse() throws Exception {
try (RestClient client = buildClient(restClientSettings(),
allNodes.stream().map(Node::getPublishAddress).toArray(HttpHost[]::new))) {
Version version = randomBoolean() ? newVersion : bwcVersion;
boolean shouldSetCcsMinimizeRoundtrips = randomBoolean();

Request request = new Request("POST", index + "/_search?min_compatible_shard_node=" + version +
(shouldSetCcsMinimizeRoundtrips ? "&ccs_minimize_roundtrips=true" : ""));
Request request = new Request("POST", index + "/_search?min_compatible_shard_node=" + version
+ "&ccs_minimize_roundtrips=true");
assertBusy(() -> {
assertWithBwcVersionCheck(() -> {
ResponseException responseException = expectThrows(ResponseException.class, () -> client.performRequest(request));
Expand All @@ -139,7 +138,7 @@ public void testCcsMinimizeRoundtripsIsFalse() throws Exception {
}

private void assertWithBwcVersionCheck(CheckedRunnable<Exception> code, RestClient client, Request request) throws Exception {
if (bwcVersion.before(Version.V_8_0_0)) {
if (bwcVersion.before(Version.V_7_12_0)) {
// min_compatible_shard_node support doesn't exist in older versions and there will be an "unrecognized parameter" exception
ResponseException exception = expectThrows(ResponseException.class, () -> client.performRequest(request));
assertThat(exception.getResponse().getStatusLine().getStatusCode(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ private enum ElasticsearchExceptionHandle {
org.elasticsearch.action.search.VersionMismatchException.class,
org.elasticsearch.action.search.VersionMismatchException::new,
161,
Version.V_8_0_0);
Version.V_7_12_0);

final Class<? extends ElasticsearchException> exceptionClass;
final CheckedFunction<StreamInput, ? extends ElasticsearchException, IOException> constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public SearchRequest(StreamInput in) throws IOException {
finalReduce = true;
}
ccsMinimizeRoundtrips = in.readBoolean();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_12_0)) {
if (in.readBoolean()) {
minCompatibleShardNode = Version.readVersion(in);
}
Expand Down Expand Up @@ -263,7 +263,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(finalReduce);
}
out.writeBoolean(ccsMinimizeRoundtrips);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_12_0)) {
out.writeBoolean(minCompatibleShardNode != null);
if (minCompatibleShardNode != null) {
Version.writeVersion(minCompatibleShardNode, out);
Expand Down

0 comments on commit b3adf2b

Please sign in to comment.