@@ -143,7 +143,7 @@ public void testSearch() throws Exception {
143143 .field ("binary" , Base64 .getEncoder ().encodeToString (randomByteArray ))
144144 .endObject ()
145145 );
146- refresh ();
146+ refreshAllIndices ();
147147 } else {
148148 count = countOfIndexedRandomDocuments ();
149149 }
@@ -708,7 +708,7 @@ public void testRecovery() throws Exception {
708708 // Count the documents in the index to make sure we have as many as we put there
709709 Request countRequest = new Request ("GET" , "/" + index + "/_search" );
710710 countRequest .addParameter ("size" , "0" );
711- refresh ();
711+ refreshAllIndices ();
712712 Map <String , Object > countResponse = entityAsMap (client ().performRequest (countRequest ));
713713 assertTotalHits (count , countResponse );
714714
@@ -795,7 +795,7 @@ public void testSnapshotRestore() throws IOException {
795795 }
796796
797797 // Refresh the index so the count doesn't fail
798- refresh ();
798+ refreshAllIndices ();
799799
800800 // Count the documents in the index to make sure we have as many as we put there
801801 Request countRequest = new Request ("GET" , "/" + index + "/_search" );
@@ -935,7 +935,7 @@ public void testSoftDeletes() throws Exception {
935935 Request request = new Request ("POST" , "/" + index + "/_doc/" + i );
936936 request .setJsonEntity (doc );
937937 client ().performRequest (request );
938- refresh ();
938+ refreshAllIndices ();
939939 }
940940 client ().performRequest (new Request ("POST" , "/" + index + "/_flush" ));
941941 int liveDocs = numDocs ;
@@ -951,7 +951,7 @@ public void testSoftDeletes() throws Exception {
951951 liveDocs --;
952952 }
953953 }
954- refresh ();
954+ refreshAllIndices ();
955955 assertTotalHits (liveDocs , entityAsMap (client ().performRequest (new Request ("GET" , "/" + index + "/_search" ))));
956956 saveInfoDocument (index + "_doc_count" , Integer .toString (liveDocs ));
957957 } else {
@@ -979,10 +979,10 @@ public void testClosedIndices() throws Exception {
979979 request .setJsonEntity (Strings .toString (JsonXContent .contentBuilder ().startObject ().field ("field" , "v1" ).endObject ()));
980980 assertOK (client ().performRequest (request ));
981981 if (rarely ()) {
982- refresh ();
982+ refreshAllIndices ();
983983 }
984984 }
985- refresh ();
985+ refreshAllIndices ();
986986 }
987987
988988 assertTotalHits (numDocs , entityAsMap (client ().performRequest (new Request ("GET" , "/" + index + "/_search" ))));
@@ -1163,7 +1163,7 @@ private void indexRandomDocuments(
11631163 createDocument .setJsonEntity (Strings .toString (docSupplier .apply (i )));
11641164 client ().performRequest (createDocument );
11651165 if (rarely ()) {
1166- refresh ();
1166+ refreshAllIndices ();
11671167 }
11681168 if (flushAllowed && rarely ()) {
11691169 logger .debug ("Flushing [{}]" , index );
@@ -1205,11 +1205,6 @@ private String loadInfoDocument(String id) throws IOException {
12051205 return m .group (1 );
12061206 }
12071207
1208- private void refresh () throws IOException {
1209- logger .debug ("Refreshing [{}]" , index );
1210- client ().performRequest (new Request ("POST" , "/" + index + "/_refresh" ));
1211- }
1212-
12131208 private List <String > dataNodes (String index , RestClient client ) throws IOException {
12141209 Request request = new Request ("GET" , index + "/_stats" );
12151210 request .addParameter ("level" , "shards" );
@@ -1427,6 +1422,10 @@ public void testSystemIndexMetadataIsUpgraded() throws Exception {
14271422
14281423 // make sure .tasks index exists
14291424 Request getTasksIndex = new Request ("GET" , "/.tasks" );
1425+ getTasksIndex .setOptions (expectVersionSpecificWarnings (v -> {
1426+ v .current (systemIndexWarning );
1427+ v .compatible (systemIndexWarning );
1428+ }));
14301429 getTasksIndex .addParameter ("allow_no_indices" , "false" );
14311430
14321431 getTasksIndex .setOptions (expectVersionSpecificWarnings (v -> {
@@ -1452,6 +1451,10 @@ public void testSystemIndexMetadataIsUpgraded() throws Exception {
14521451 " {\" add\" : {\" index\" : \" test_index_reindex\" , \" alias\" : \" test-system-alias\" }}\n " +
14531452 " ]\n " +
14541453 "}" );
1454+ putAliasRequest .setOptions (expectVersionSpecificWarnings (v -> {
1455+ v .current (systemIndexWarning );
1456+ v .compatible (systemIndexWarning );
1457+ }));
14551458 assertThat (client ().performRequest (putAliasRequest ).getStatusLine ().getStatusCode (), is (200 ));
14561459 }
14571460 } else {
0 commit comments