From 848a5981fe2cc016b7f18223cb616aead0899644 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 19 Nov 2018 17:50:36 +0100 Subject: [PATCH] TESTS: More Logging in LongGcDisruptionTests * The existing logging is not helpful enough to track down which threads hang, we need the hanging thread's stacktraces too * Relates #35686 --- .../test/disruption/LongGCDisruption.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java b/test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java index 06dca1f643842..61b4349ba3fe3 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java +++ b/test/framework/src/main/java/org/elasticsearch/test/disruption/LongGCDisruption.java @@ -103,8 +103,14 @@ protected void doRun() throws Exception { throw new RuntimeException("unknown error while suspending threads", suspendingError.get()); } if (suspendingThread.isAlive()) { - logger.warn("failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}" - , disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace())); + logger.warn( + "failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}" + + "\nThreads that weren't suspended:\n {}" + , disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace()), + suspendedThreads.stream() + .map(t -> t.getName() + "\n----\n" + stackTrace(t.getStackTrace())) + .collect(Collectors.joining("\n")) + ); suspendingThread.interrupt(); // best effort; try { /*