From f0d1a00f800b4863337e9f55953e7f9f503cfd78 Mon Sep 17 00:00:00 2001 From: Trent Mohay <37158202+rain-on@users.noreply.github.com> Date: Thu, 21 Nov 2019 14:54:23 +1100 Subject: [PATCH] Repair intermittent test failure in NewPendingTransactionAcceptanctTest (#195) Signed-off-by: Trent Mohay --- .../dsl/pubsub/WebSocketConnection.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/pubsub/WebSocketConnection.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/pubsub/WebSocketConnection.java index 89e8814ed3..f52d533db6 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/pubsub/WebSocketConnection.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/pubsub/WebSocketConnection.java @@ -30,6 +30,7 @@ import io.vertx.core.http.RequestOptions; import io.vertx.core.http.WebSocket; import io.vertx.core.json.DecodeException; import io.vertx.core.json.Json; +import org.apache.commons.lang3.exception.ExceptionUtils; public class WebSocketConnection { @@ -102,7 +103,11 @@ public class WebSocketConnection { } } catch (final DecodeException e) { - error(data.toString()); + error( + "Data: " + + data.toString() + + "\nException: " + + ExceptionUtils.getStackTrace(e)); } }); }); @@ -115,24 +120,24 @@ public class WebSocketConnection { } private void resetLatestResult() { - this.receivedResponse = false; this.error = null; this.latestEvent = null; + this.receivedResponse = false; } private void error(final String response) { - this.receivedResponse = true; this.error = response; + this.receivedResponse = true; } private void success(final JsonRpcSuccessEvent result) { - this.receivedResponse = true; this.latestEvent = result; + this.receivedResponse = true; } private void success(final SubscriptionEvent result) { - this.receivedResponse = true; this.subscriptionEvents.add(result); + this.receivedResponse = true; } public List getSubscriptionEvents() {