From a593e35d8282152bee6d1f975e04c8d43a0082e5 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Wed, 13 Jan 2010 12:22:22 +0000 Subject: [PATCH] resolve intermittent failure of InactivityMonitorTest, test needed to pass negotiation to enable inactivity monitor with a version > 1 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@898730 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/transport/InactivityMonitor.java | 2 +- .../apache/activemq/transport/tcp/InactivityMonitorTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java index 083608968a..3f0638e559 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java @@ -170,7 +170,7 @@ public class InactivityMonitor extends TransportFilter { } ASYNC_TASKS.execute(new Runnable() { public void run() { - onException(new InactivityIOException("Channel was inactive for too long: "+next.getRemoteAddress())); + onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: "+next.getRemoteAddress())); }; }); diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java index 76da11eed8..71087272bf 100644 --- a/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java @@ -185,6 +185,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra }); clientTransport.start(); WireFormatInfo info = new WireFormatInfo(); + info.setVersion(OpenWireFormat.DEFAULT_VERSION); info.setMaxInactivityDuration(1000); clientTransport.oneway(info); @@ -193,7 +194,7 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra // Server should consider the client timed out right away since the // client is not hart beating fast enough. - Thread.sleep(3000); + Thread.sleep(6000); assertEquals(0, clientErrorCount.get()); assertTrue(serverErrorCount.get() > 0);