Prechádzať zdrojové kódy

[TEST] Mute testCancelAsyncRequests instead of the whole class

Also fixes one test issue as the client was hitting the wrong endpoint.
But the test remains problematic as the underlying http client crashes
in the middle of it.

Relates to #45577
Luca Cavanna 6 rokov pred
rodič
commit
0ae24af4c8

+ 2 - 4
client/rest/src/test/java/org/elasticsearch/client/RestClientMultipleHostsIntegTests.java

@@ -54,7 +54,6 @@ import static org.junit.Assert.fail;
  * Integration test to check interaction between {@link RestClient} and {@link org.apache.http.client.HttpClient}.
  * Works against real http servers, multiple hosts. Also tests failover by randomly shutting down hosts.
  */
-@Ignore("https://github.com/elastic/elasticsearch/issues/45577")
 public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
 
     private static WaitForCancelHandler waitForCancelHandler;
@@ -226,6 +225,7 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
         }
     }
 
+    @Ignore("https://github.com/elastic/elasticsearch/issues/45577")
     public void testCancelAsyncRequests() throws Exception {
         int numRequests = randomIntBetween(5, 20);
         final CountDownLatch latch = new CountDownLatch(numRequests);
@@ -234,9 +234,7 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
         for (int i = 0; i < numRequests; i++) {
             waitForCancelHandler.reset();
             final String method = RestClientTestUtil.randomHttpMethod(getRandom());
-            //we don't test status codes that are subject to retries as they interfere with hosts being stopped
-            final int statusCode = randomBoolean() ? randomOkStatusCode(getRandom()) : randomErrorNoRetryStatusCode(getRandom());
-            Cancellable cancellable = restClient.performRequestAsync(new Request(method, "/" + statusCode), new ResponseListener() {
+            Cancellable cancellable = restClient.performRequestAsync(new Request(method, "/wait"), new ResponseListener() {
                 @Override
                 public void onSuccess(Response response) {
                     responses.add(response);