Browse Source

Remove unknown HttpContext-based test as it fails unpredictably on different JVMs

Chris Earle 9 years ago
parent
commit
c05d5f9257

+ 0 - 30
client/rest/src/test/java/org/elasticsearch/client/RestClientIntegTests.java

@@ -207,36 +207,6 @@ public class RestClientIntegTests extends RestClientTestCase {
         bodyTest("GET");
     }
 
-    /**
-     * Ensure that pathPrefix works as expected even when the path does not exist.
-     */
-    public void testPathPrefixUnknownPath() throws IOException {
-        // guarantee no other test setup collides with this one and lets it sneak through
-        final String uniqueContextSuffix = "/testPathPrefixUnknownPath";
-        final String pathPrefix = "dne/" + randomAsciiOfLengthBetween(1, 5) + "/";
-        final int statusCode = randomStatusCode(getRandom());
-
-        try (final RestClient client =
-                RestClient.builder(new HttpHost(httpServer.getAddress().getHostString(), httpServer.getAddress().getPort()))
-                    .setPathPrefix((randomBoolean() ? "/" : "") + pathPrefix).build()) {
-
-            for (final String method : getHttpMethods()) {
-                Response esResponse;
-                try {
-                    esResponse = client.performRequest(method, "/" + statusCode + uniqueContextSuffix);
-                    if ("HEAD".equals(method) == false) {
-                        fail("only HEAD requests should not throw an exception; 404 is expected");
-                    }
-                } catch(ResponseException e) {
-                    esResponse = e.getResponse();
-                }
-
-                assertThat(esResponse.getRequestLine().getUri(), equalTo("/" + pathPrefix + statusCode + uniqueContextSuffix));
-                assertThat(esResponse.getStatusLine().getStatusCode(), equalTo(404));
-            }
-        }
-    }
-
     /**
      * Ensure that pathPrefix works as expected.
      */