Skip to content

Commit

Permalink
Issue #12272 - Potential deadlock with Vaadin.
Browse files Browse the repository at this point in the history
Updated test case to use Input/OutputStream as well as Reader/Writer.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Nov 8, 2024
1 parent 473445b commit 9f8cc61
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.eclipse.jetty.util.FuturePromise;
import org.eclipse.jetty.util.component.LifeCycle;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

Expand Down Expand Up @@ -223,8 +222,9 @@ public void onStartAsync(AsyncEvent event)
assertTrue(errorLatch.await(5, TimeUnit.SECONDS));
}

@Test
public void testSessionShutdownWithPendingRequest() throws Exception
@ParameterizedTest
@ValueSource(booleans = {false, true})
public void testSessionShutdownWithPendingRequest(boolean useReaderWriter) throws Exception
{
CountDownLatch serverFailureLatch = new CountDownLatch(1);
start(new HttpServlet()
Expand All @@ -234,7 +234,10 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
{
try
{
request.getInputStream().transferTo(response.getOutputStream());
if (useReaderWriter)
request.getReader().transferTo(response.getWriter());
else
request.getInputStream().transferTo(response.getOutputStream());
}
catch (Throwable x)
{
Expand Down

0 comments on commit 9f8cc61

Please sign in to comment.