Skip to content

Commit 100537f

Browse files
Target only specific index in update settings test
With this commit we limit the update settings request to the index that is used in `IndicesClientIT#testIndexPutSettings()`. This avoids spurious exceptions involving other indices that might also be present in the test cluster. Closes #36931 Relates #37338
1 parent 1de286b commit 100537f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ public void testIndexPutSettings() throws IOException {
11771177
createIndex(index, Settings.EMPTY);
11781178

11791179
assertThat(dynamicSetting.getDefault(Settings.EMPTY), not(dynamicSettingValue));
1180-
UpdateSettingsRequest dynamicSettingRequest = new UpdateSettingsRequest();
1180+
UpdateSettingsRequest dynamicSettingRequest = new UpdateSettingsRequest(index);
11811181
dynamicSettingRequest.settings(Settings.builder().put(dynamicSettingKey, dynamicSettingValue).build());
11821182
AcknowledgedResponse response = execute(dynamicSettingRequest, highLevelClient().indices()::putSettings,
11831183
highLevelClient().indices()::putSettingsAsync);
@@ -1187,7 +1187,7 @@ public void testIndexPutSettings() throws IOException {
11871187
assertThat(indexSettingsAsMap.get(dynamicSettingKey), equalTo(String.valueOf(dynamicSettingValue)));
11881188

11891189
assertThat(staticSetting.getDefault(Settings.EMPTY), not(staticSettingValue));
1190-
UpdateSettingsRequest staticSettingRequest = new UpdateSettingsRequest();
1190+
UpdateSettingsRequest staticSettingRequest = new UpdateSettingsRequest(index);
11911191
staticSettingRequest.settings(Settings.builder().put(staticSettingKey, staticSettingValue).build());
11921192
ElasticsearchException exception = expectThrows(ElasticsearchException.class, () -> execute(staticSettingRequest,
11931193
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
@@ -1207,7 +1207,7 @@ public void testIndexPutSettings() throws IOException {
12071207
assertThat(indexSettingsAsMap.get(staticSettingKey), equalTo(staticSettingValue));
12081208

12091209
assertThat(unmodifiableSetting.getDefault(Settings.EMPTY), not(unmodifiableSettingValue));
1210-
UpdateSettingsRequest unmodifiableSettingRequest = new UpdateSettingsRequest();
1210+
UpdateSettingsRequest unmodifiableSettingRequest = new UpdateSettingsRequest(index);
12111211
unmodifiableSettingRequest.settings(Settings.builder().put(unmodifiableSettingKey, unmodifiableSettingValue).build());
12121212
exception = expectThrows(ElasticsearchException.class, () -> execute(unmodifiableSettingRequest,
12131213
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));

0 commit comments

Comments
 (0)