22
22
import org .apache .http .util .EntityUtils ;
23
23
import org .elasticsearch .Version ;
24
24
import org .elasticsearch .client .Request ;
25
+ import org .elasticsearch .client .RequestOptions ;
25
26
import org .elasticsearch .client .Response ;
26
27
import org .elasticsearch .client .ResponseException ;
27
28
import org .elasticsearch .client .RestClient ;
29
+ import org .elasticsearch .client .WarningsHandler ;
28
30
import org .elasticsearch .cluster .metadata .IndexMetaData ;
29
31
import org .elasticsearch .common .Booleans ;
30
32
import org .elasticsearch .common .CheckedFunction ;
@@ -85,7 +87,6 @@ public void setIndex() throws IOException {
85
87
index = getTestName ().toLowerCase (Locale .ROOT );
86
88
}
87
89
88
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/37920" )
89
90
public void testSearch () throws Exception {
90
91
int count ;
91
92
if (isRunningAgainstOldCluster ()) {
@@ -124,6 +125,9 @@ public void testSearch() throws Exception {
124
125
mappingsAndSettings .endObject ();
125
126
Request createIndex = new Request ("PUT" , "/" + index );
126
127
createIndex .setJsonEntity (Strings .toString (mappingsAndSettings ));
128
+ RequestOptions .Builder options = createIndex .getOptions ().toBuilder ();
129
+ options .setWarningsHandler (WarningsHandler .PERMISSIVE );
130
+ createIndex .setOptions (options );
127
131
client ().performRequest (createIndex );
128
132
129
133
count = randomIntBetween (2000 , 3000 );
@@ -153,7 +157,6 @@ public void testSearch() throws Exception {
153
157
assertStoredBinaryFields (count );
154
158
}
155
159
156
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/37920" )
157
160
public void testNewReplicasWork () throws Exception {
158
161
if (isRunningAgainstOldCluster ()) {
159
162
XContentBuilder mappingsAndSettings = jsonBuilder ();
@@ -180,6 +183,9 @@ public void testNewReplicasWork() throws Exception {
180
183
mappingsAndSettings .endObject ();
181
184
Request createIndex = new Request ("PUT" , "/" + index );
182
185
createIndex .setJsonEntity (Strings .toString (mappingsAndSettings ));
186
+ RequestOptions .Builder options = createIndex .getOptions ().toBuilder ();
187
+ options .setWarningsHandler (WarningsHandler .PERMISSIVE );
188
+ createIndex .setOptions (options );
183
189
client ().performRequest (createIndex );
184
190
185
191
int numDocs = randomIntBetween (2000 , 3000 );
@@ -332,7 +338,6 @@ public void testClusterState() throws Exception {
332
338
333
339
}
334
340
335
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/37920" )
336
341
public void testShrink () throws IOException {
337
342
String shrunkenIndex = index + "_shrunk" ;
338
343
int numDocs ;
@@ -355,6 +360,9 @@ public void testShrink() throws IOException {
355
360
mappingsAndSettings .endObject ();
356
361
Request createIndex = new Request ("PUT" , "/" + index );
357
362
createIndex .setJsonEntity (Strings .toString (mappingsAndSettings ));
363
+ RequestOptions .Builder options = createIndex .getOptions ().toBuilder ();
364
+ options .setWarningsHandler (WarningsHandler .PERMISSIVE );
365
+ createIndex .setOptions (options );
358
366
client ().performRequest (createIndex );
359
367
360
368
numDocs = randomIntBetween (512 , 1024 );
@@ -401,7 +409,6 @@ public void testShrink() throws IOException {
401
409
assertEquals (numDocs , totalHits );
402
410
}
403
411
404
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/37920" )
405
412
public void testShrinkAfterUpgrade () throws IOException {
406
413
String shrunkenIndex = index + "_shrunk" ;
407
414
int numDocs ;
@@ -424,6 +431,9 @@ public void testShrinkAfterUpgrade() throws IOException {
424
431
mappingsAndSettings .endObject ();
425
432
Request createIndex = new Request ("PUT" , "/" + index );
426
433
createIndex .setJsonEntity (Strings .toString (mappingsAndSettings ));
434
+ RequestOptions .Builder options = createIndex .getOptions ().toBuilder ();
435
+ options .setWarningsHandler (WarningsHandler .PERMISSIVE );
436
+ createIndex .setOptions (options );
427
437
client ().performRequest (createIndex );
428
438
429
439
numDocs = randomIntBetween (512 , 1024 );
0 commit comments