Skip to content

Enable bwc tests after elastic#67414 merge #67430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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