From 69b3c37717f55dd78c1d5bda863af7dd7d461241 Mon Sep 17 00:00:00 2001 From: gregw Date: Mon, 30 Nov 2020 17:35:37 +0100 Subject: [PATCH] remove test rather than disable Signed-off-by: gregw --- .../jetty/http/client/ServerTimeoutsTest.java | 99 ------------------- 1 file changed, 99 deletions(-) diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java index 4a2560911a2c..18c45740a86e 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.io.InterruptedIOException; import java.nio.ByteBuffer; -import java.rmi.ServerException; import java.util.Random; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; @@ -54,7 +53,6 @@ import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; @@ -755,103 +753,6 @@ public void testBlockingReadHttpIdleTimeoutOverridesIdleTimeout(Transport transp } } - @ParameterizedTest - @ArgumentsSource(TransportProvider.class) - @Disabled // TODO #5737 - public void testBlockingReadInOtherThreadThenComplete(Transport transport) throws Exception - { - init(transport); - BlockingReadAndCompleteHandler handler = new BlockingReadAndCompleteHandler(); - scenario.start(handler); - - try /*(StacklessLogging ignore = new StacklessLogging(HttpChannel.class))*/ - { - DeferredContentProvider contentProvider = new DeferredContentProvider(ByteBuffer.allocate(1)); - CountDownLatch resultLatch = new CountDownLatch(1); - scenario.client.POST(scenario.newURI()) - .content(contentProvider) - .send(result -> - { - if (result.getResponse().getStatus() == 299) - resultLatch.countDown(); - }); - - // Blocking read should error. - assertTrue(handler.readErrorLatch.await(5, TimeUnit.SECONDS)); - - // request should complete without waiting for content. - assertTrue(handler.readErrorLatch.await(1, TimeUnit.SECONDS)); - - // Complete the request. - contentProvider.close(); - assertTrue(resultLatch.await(5, TimeUnit.SECONDS)); - } - catch (Exception e) - { - throw e; - } - } - - private static class BlockingReadAndCompleteHandler extends AbstractHandler - { - CountDownLatch readErrorLatch; - CountDownLatch completeLatch; - - public BlockingReadAndCompleteHandler() - { - this.readErrorLatch = new CountDownLatch(1); - this.completeLatch = new CountDownLatch(1); - } - - @Override - public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException - { - baseRequest.setHandled(true); - AsyncContext asyncContext = baseRequest.startAsync(); - ServletInputStream input = request.getInputStream(); - CountDownLatch reading = new CountDownLatch(1); - new Thread(() -> - { - try - { - response.setStatus(289); - while (input.read() >= 0) - { - reading.countDown(); - } - } - catch (IOException x) - { - readErrorLatch.countDown(); - } - }).start(); - - try - { - reading.await(); - } - catch (Exception e) - { - throw new ServletException(e); - } - - new Thread(() -> - { - try - { - Thread.sleep(500); - response.setStatus(299); - asyncContext.complete(); - completeLatch.countDown(); - } - catch (InterruptedException x) - { - throw new IllegalStateException(x); - } - }).start(); - } - } - @ParameterizedTest @ArgumentsSource(TransportProvider.class) public void testAsyncReadHttpIdleTimeoutOverridesIdleTimeout(Transport transport) throws Exception