Skip to content

Commit 0db51d5

Browse files
authored
Remove disabling field names test (#116937)
The test is conditional on the old version being pre-v8, which is never true on main now
1 parent d33bff6 commit 0db51d5

File tree

2 files changed

+0
-82
lines changed

2 files changed

+0
-82
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/RestTestLegacyFeatures.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ public class RestTestLegacyFeatures implements FeatureSpecification {
7878
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
7979
public static final NodeFeature NEW_DATA_STREAMS_INDEX_NAME_FORMAT = new NodeFeature("data_stream.new_index_name_format");
8080
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
81-
public static final NodeFeature DISABLE_FIELD_NAMES_FIELD_REMOVED = new NodeFeature("disable_of_field_names_field_removed");
82-
@UpdateForV9(owner = UpdateForV9.Owner.CORE_INFRA)
8381
public static final NodeFeature ML_NLP_SUPPORTED = new NodeFeature("ml.nlp_supported");
8482

8583
// YAML
@@ -113,7 +111,6 @@ public Map<NodeFeature, Version> getHistoricalFeatures() {
113111
entry(SLM_SUPPORTED, Version.V_7_4_0),
114112
entry(DATA_STREAMS_SUPPORTED, Version.V_7_9_0),
115113
entry(NEW_DATA_STREAMS_INDEX_NAME_FORMAT, Version.V_7_11_0),
116-
entry(DISABLE_FIELD_NAMES_FIELD_REMOVED, Version.V_8_0_0),
117114
entry(ML_NLP_SUPPORTED, Version.V_8_0_0)
118115
);
119116
}

x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.core.UpdateForV9;
2727
import org.elasticsearch.rest.RestStatus;
2828
import org.elasticsearch.rest.action.search.RestSearchAction;
29-
import org.elasticsearch.test.MapMatcher;
3029
import org.elasticsearch.test.StreamsUtils;
3130
import org.elasticsearch.test.rest.ESRestTestCase;
3231
import org.elasticsearch.test.rest.RestTestLegacyFeatures;
@@ -53,8 +52,6 @@
5352
import java.util.stream.Collectors;
5453

5554
import static org.elasticsearch.core.TimeValue.timeValueSeconds;
56-
import static org.elasticsearch.test.MapMatcher.assertMap;
57-
import static org.elasticsearch.test.MapMatcher.matchesMap;
5855
import static org.elasticsearch.upgrades.FullClusterRestartIT.assertNumHits;
5956
import static org.hamcrest.Matchers.anyOf;
6057
import static org.hamcrest.Matchers.containsString;
@@ -965,82 +962,6 @@ public void testDataStreams() throws Exception {
965962
assertNumHits("ds", 1, 1);
966963
}
967964

968-
/**
969-
* Tests that a single document survives. Super basic smoke test.
970-
*/
971-
@UpdateForV9(owner = UpdateForV9.Owner.SEARCH_FOUNDATIONS) // Can be removed
972-
public void testDisableFieldNameField() throws IOException {
973-
assumeFalse(
974-
"can only disable field names field before 8.0",
975-
oldClusterHasFeature(RestTestLegacyFeatures.DISABLE_FIELD_NAMES_FIELD_REMOVED)
976-
);
977-
978-
String docLocation = "/nofnf/_doc/1";
979-
String doc = """
980-
{
981-
"dv": "test",
982-
"no_dv": "test"
983-
}""";
984-
985-
if (isRunningAgainstOldCluster()) {
986-
Request createIndex = new Request("PUT", "/nofnf");
987-
createIndex.setJsonEntity("""
988-
{
989-
"settings": {
990-
"index": {
991-
"number_of_replicas": 1
992-
}
993-
},
994-
"mappings": {
995-
"_field_names": { "enabled": false },
996-
"properties": {
997-
"dv": { "type": "keyword" },
998-
"no_dv": { "type": "keyword", "doc_values": false }
999-
}
1000-
}
1001-
}""");
1002-
createIndex.setOptions(RequestOptions.DEFAULT.toBuilder().setWarningsHandler(fieldNamesFieldOk()));
1003-
client().performRequest(createIndex);
1004-
1005-
Request createDoc = new Request("PUT", docLocation);
1006-
createDoc.addParameter("refresh", "true");
1007-
createDoc.setJsonEntity(doc);
1008-
client().performRequest(createDoc);
1009-
}
1010-
1011-
Request getRequest = new Request("GET", docLocation);
1012-
assertThat(toStr(client().performRequest(getRequest)), containsString(doc));
1013-
1014-
if (isRunningAgainstOldCluster() == false) {
1015-
Request esql = new Request("POST", "_query");
1016-
esql.setJsonEntity("""
1017-
{
1018-
"query": "FROM nofnf | LIMIT 1"
1019-
}""");
1020-
// {"columns":[{"name":"dv","type":"keyword"},{"name":"no_dv","type":"keyword"}],"values":[["test",null]]}
1021-
try {
1022-
Map<String, Object> result = entityAsMap(client().performRequest(esql));
1023-
MapMatcher mapMatcher = matchesMap();
1024-
if (result.get("took") != null) {
1025-
mapMatcher = mapMatcher.entry("took", ((Integer) result.get("took")).intValue());
1026-
}
1027-
assertMap(
1028-
result,
1029-
mapMatcher.entry(
1030-
"columns",
1031-
List.of(Map.of("name", "dv", "type", "keyword"), Map.of("name", "no_dv", "type", "keyword"))
1032-
).entry("values", List.of(List.of("test", "test")))
1033-
);
1034-
} catch (ResponseException e) {
1035-
logger.error(
1036-
"failed to query index without field name field. Existing indices:\n{}",
1037-
EntityUtils.toString(client().performRequest(new Request("GET", "_cat/indices")).getEntity())
1038-
);
1039-
throw e;
1040-
}
1041-
}
1042-
}
1043-
1044965
/**
1045966
* Ignore the warning about the {@code _field_names} field. We intentionally
1046967
* turn that field off sometimes. And other times old versions spuriously

0 commit comments

Comments
 (0)