Skip to content

Commit

Permalink
ESQL: Fix old version tests (elastic#104333)
Browse files Browse the repository at this point in the history
This weakens an assertion in the ESQL tests rolling upgrade tests so
they'll pass against older versions of Elasticsearch. Apparently the
warning message changed. There isn't a good reason to be so strict about
the assertion anyway.

Closes elastic#104101
  • Loading branch information
nik9000 authored Jan 12, 2024
1 parent 97d0c8c commit 3da01e0
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.core.UpdateForV9;
import org.elasticsearch.index.mapper.FieldNamesFieldMapper;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.test.StreamsUtils;
Expand Down Expand Up @@ -996,7 +995,6 @@ public void testDataStreams() throws Exception {
/**
* Tests that a single document survives. Super basic smoke test.
*/
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/104101")
public void testDisableFieldNameField() throws IOException {
assumeTrue("can only disable field names field before 8.0", Version.fromString(getOldClusterVersion()).before(Version.V_8_0_0));
String docLocation = "/nofnf/_doc/1";
Expand All @@ -1023,10 +1021,11 @@ public void testDisableFieldNameField() throws IOException {
}
}
}""");
createIndex.setOptions(
RequestOptions.DEFAULT.toBuilder()
.setWarningsHandler(warnings -> false == warnings.equals(List.of(FieldNamesFieldMapper.ENABLED_DEPRECATION_MESSAGE)))
);
createIndex.setOptions(RequestOptions.DEFAULT.toBuilder().setWarningsHandler(warnings -> switch (warnings.size()) {
case 0 -> false; // old versions don't return a warning
case 1 -> false == warnings.get(0).contains("_field_names");
default -> true;
}));
client().performRequest(createIndex);

Request createDoc = new Request("PUT", docLocation);
Expand Down

0 comments on commit 3da01e0

Please sign in to comment.