Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Dec 25, 2024
1 parent ae197ab commit d4da186
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1377,18 +1377,20 @@ public long getLength()
client.newRequest(newURI(transportType))
.method(HttpMethod.POST)
.body(content)
.send(result ->
.onResponseHeaders(response ->
{
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, result.getResponse().getStatus());
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, response.getStatus());
latch.countDown();
});
})
.send(null);

// Wait for the server to idle timeout.
Thread.sleep(2 * idleTimeout);

assertTrue(errorLatch.await(5, TimeUnit.SECONDS));

// Do not send the content to the server.
// The exchange is not completed because the request is not completed.

assertFalse(dataLatch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,18 +1377,20 @@ public long getLength()
client.newRequest(newURI(transportType))
.method(HttpMethod.POST)
.body(content)
.send(result ->
.onResponseHeaders(response ->
{
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, result.getResponse().getStatus());
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, response.getStatus());
latch.countDown();
});
})
.send(null);

// Wait for the server to idle timeout.
Thread.sleep(2 * idleTimeout);

assertTrue(errorLatch.await(5, TimeUnit.SECONDS));

// Do not send the content to the server.
// The exchange is not completed because the request is not completed.

assertFalse(dataLatch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1782,18 +1782,20 @@ public long getLength()
client.newRequest(newURI(transportType))
.method(HttpMethod.POST)
.body(content)
.send(result ->
.onResponseHeaders(response ->
{
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, result.getResponse().getStatus());
Assertions.assertEquals(HttpStatus.REQUEST_TIMEOUT_408, response.getStatus());
latch.countDown();
});
})
.send(null);

// Wait for the server to idle timeout.
Thread.sleep(2 * idleTimeout);

assertTrue(errorLatch.await(5, TimeUnit.SECONDS));

// Do not send the content to the server.
// The exchange is not completed because the request is not completed.

assertFalse(dataLatch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.eclipse.jetty.LEVEL=DEBUG
#org.eclipse.jetty.LEVEL=DEBUG
org.eclipse.jetty.jmx.LEVEL=INFO
#org.eclipse.jetty.client.LEVEL=DEBUG
#org.eclipse.jetty.fcgi.LEVEL=DEBUG
Expand Down

0 comments on commit d4da186

Please sign in to comment.