Repository: activemq Updated Branches: refs/heads/trunk 67f151fe0 -> 128921e68
some more info to this test to help diagnose intermittent ci failure, works fine locally Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/128921e6 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/128921e6 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/128921e6 Branch: refs/heads/trunk Commit: 128921e687cdedfe86c035b88f84e506fa8bbb9a Parents: 67f151f Author: gtully <[email protected]> Authored: Wed Mar 12 14:01:08 2014 +0000 Committer: gtully <[email protected]> Committed: Wed Mar 12 14:01:08 2014 +0000 ---------------------------------------------------------------------- .../org/apache/activemq/bugs/AMQ2149Test.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/128921e6/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java index 891822f..ee80c08 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2149Test.java @@ -19,6 +19,7 @@ package org.apache.activemq.bugs; import java.io.File; import java.lang.IllegalStateException; +import java.util.Arrays; import java.util.HashSet; import java.util.Timer; import java.util.TimerTask; @@ -518,12 +519,17 @@ public class AMQ2149Test { threads.add(thread); } - final long expiry = System.currentTimeMillis() + 1000 * 60 * 30; + final long expiry = System.currentTimeMillis() + 1000 * 60 * 4; while(!threads.isEmpty() && exceptions.isEmpty() && System.currentTimeMillis() < expiry) { Thread sendThread = threads.firstElement(); - sendThread.join(1000*10); + sendThread.join(1000*20); if (!sendThread.isAlive()) { threads.remove(sendThread); + } else { + Throwable throwable = new Throwable("blocked send thread"); + throwable.setStackTrace(sendThread.getStackTrace()); + LOG.error("Send thread blocked", throwable); + throwable.printStackTrace(); } } LOG.info("senders done..." + threads); @@ -535,10 +541,6 @@ public class AMQ2149Test { receivers.remove(receiver); } } - assertTrue("No timeout waiting for senders/receivers to complete", System.currentTimeMillis() < expiry); - if (!exceptions.isEmpty()) { - exceptions.get(0).printStackTrace(); - } for (Connection connection : connections) { try { @@ -547,6 +549,11 @@ public class AMQ2149Test { } connections.clear(); + assertTrue("No timeout waiting for senders/receivers to complete", System.currentTimeMillis() < expiry); + if (!exceptions.isEmpty()) { + exceptions.get(0).printStackTrace(); + } + LOG.info("Dangling threads: " + threads); for (Thread dangling : threads) { dangling.interrupt();
