- * once the delay is removed: - * - the subsequent requests should be successful - */ - @ParameterizedTest - @EnumSource(Protocol.class) - void connectionTimeout(Protocol protocol) throws IOException, InterruptedException { - // https://github.com/vert-x3/vertx-web/issues/2296 - // WebClient: HTTP/2 request timeout does not throw TimeoutException - assumeTrue(protocol != Protocol.HTTP2_VPACK); - assumeTrue(protocol != Protocol.HTTP2_JSON); - - ArangoDB arangoDB = dbBuilder() - .timeout(1_000) - .protocol(protocol) - .build(); - - arangoDB.getVersion(); - - // slow down the driver connection - Latency toxic = getEndpoints().get(0).getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000); - Thread.sleep(100); - - // no failover for TimeoutException - for (int i = 0; i < 2; i++) { - Throwable thrown = catchThrowable(arangoDB::getVersion); - thrown.printStackTrace(); - assertThat(thrown) - .isInstanceOf(ArangoDBException.class) - .extracting(Throwable::getCause) - .isInstanceOf(TimeoutException.class); - } - - toxic.remove(); - Thread.sleep(100); - - arangoDB.getVersion(); - arangoDB.shutdown(); - } - - /** - * on delayed response: - * - ArangoDBException with cause TimeoutException - *
- * once the delay is removed:
- * - the subsequent requests should be successful
- */
- @ParameterizedTest
- @EnumSource(Protocol.class)
- void connectionTimeoutAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException {
- // https://github.com/vert-x3/vertx-web/issues/2296
- // WebClient: HTTP/2 request timeout does not throw TimeoutException
- assumeTrue(protocol != Protocol.HTTP2_VPACK);
- assumeTrue(protocol != Protocol.HTTP2_JSON);
-
- ArangoDBAsync arangoDB = dbBuilder()
- .timeout(1_000)
- .protocol(protocol)
- .build()
- .async();
-
- arangoDB.getVersion().get();
-
- // slow down the driver connection
- Latency toxic = getEndpoints().get(0).getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000);
- Thread.sleep(100);
-
- // no failover for TimeoutException
- for (int i = 0; i < 2; i++) {
- Throwable thrown = catchThrowable(() -> arangoDB.getVersion().get()).getCause();
- thrown.printStackTrace();
- assertThat(thrown)
- .isInstanceOf(ArangoDBException.class)
- .extracting(Throwable::getCause)
- .isInstanceOf(TimeoutException.class);
- }
-
- toxic.remove();
- Thread.sleep(100);
-
- arangoDB.getVersion().get();
- arangoDB.shutdown();
- }
-
@ParameterizedTest
@EnumSource(Protocol.class)
@@ -306,7 +219,6 @@ void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, Inter
es.schedule(() -> getEndpoints().get(0).disable(), 300, TimeUnit.MILLISECONDS);
Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class));
- thrown.printStackTrace();
assertThat(thrown).isInstanceOf(ArangoDBException.class);
assertThat(thrown.getCause()).isInstanceOf(IOException.class);
if (protocol != Protocol.VST) {
@@ -344,7 +256,6 @@ void notRetryPostOnClosedConnectionAsync(Protocol protocol) throws IOException,
es.schedule(() -> getEndpoints().get(0).disable(), 300, TimeUnit.MILLISECONDS);
Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class).get()).getCause();
- thrown.printStackTrace();
assertThat(thrown).isInstanceOf(ArangoDBException.class);
assertThat(thrown.getCause()).isInstanceOf(IOException.class);
if (protocol != Protocol.VST) {
diff --git a/resilience-tests/src/test/java/resilience/retry/RetryTest.java b/resilience-tests/src/test/java/resilience/retry/RetryTest.java
index 0fce057c4..84441e5d3 100644
--- a/resilience-tests/src/test/java/resilience/retry/RetryTest.java
+++ b/resilience-tests/src/test/java/resilience/retry/RetryTest.java
@@ -113,11 +113,6 @@ void unreachableHostAsync(ArangoDBAsync arangoDB) throws ExecutionException, Int
@ParameterizedTest
@EnumSource(Protocol.class)
void connectionTimeout(Protocol protocol) throws IOException, InterruptedException {
- // https://github.com/vert-x3/vertx-web/issues/2296
- // WebClient: HTTP/2 request timeout does not throw TimeoutException
- assumeTrue(protocol != Protocol.HTTP2_VPACK);
- assumeTrue(protocol != Protocol.HTTP2_JSON);
-
ArangoDB arangoDB = dbBuilder()
.timeout(1_000)
.protocol(protocol)
@@ -130,7 +125,6 @@ void connectionTimeout(Protocol protocol) throws IOException, InterruptedExcepti
Thread.sleep(100);
Throwable thrown = catchThrowable(arangoDB::getVersion);
- thrown.printStackTrace();
assertThat(thrown)
.isInstanceOf(ArangoDBException.class)
.extracting(Throwable::getCause)
@@ -153,11 +147,6 @@ void connectionTimeout(Protocol protocol) throws IOException, InterruptedExcepti
@ParameterizedTest
@EnumSource(Protocol.class)
void connectionTimeoutAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException {
- // https://github.com/vert-x3/vertx-web/issues/2296
- // WebClient: HTTP/2 request timeout does not throw TimeoutException
- assumeTrue(protocol != Protocol.HTTP2_VPACK);
- assumeTrue(protocol != Protocol.HTTP2_JSON);
-
ArangoDBAsync arangoDB = dbBuilder()
.timeout(1_000)
.protocol(protocol)
@@ -171,7 +160,6 @@ void connectionTimeoutAsync(Protocol protocol) throws IOException, InterruptedEx
Thread.sleep(100);
Throwable thrown = catchThrowable(() -> arangoDB.getVersion().get()).getCause();
- thrown.printStackTrace();
assertThat(thrown)
.isInstanceOf(ArangoDBException.class)
.extracting(Throwable::getCause)
@@ -213,7 +201,6 @@ void retryGetOnClosedConnection(Protocol protocol) throws IOException, Interrupt
es.schedule(() -> getEndpoint().disable(), 300, TimeUnit.MILLISECONDS);
Throwable thrown = catchThrowable(arangoDB::getVersion);
- thrown.printStackTrace();
assertThat(thrown).isInstanceOf(ArangoDBException.class);
assertThat(thrown.getCause()).isInstanceOf(ArangoDBMultipleException.class);
List