merge #80 - Fix test, adjust logging

This commit is contained in:
Andy Taylor 2015-01-27 09:11:26 +00:00
commit 3498b7b0f9
5 changed files with 11 additions and 10 deletions

View File

@ -97,8 +97,8 @@ public interface ActiveMQClientMessageBundle
@Message(id = 119013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT) @Message(id = 119013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup); ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
@Message(id = 119014, value = "Timed out waiting for response when sending packet {0}", format = Message.Format.MESSAGE_FORMAT) @Message(id = 119014, value = "Timed out after waiting {0} ms for response when sending packet {1}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQConnectionTimedOutException timedOutSendingPacket(Byte type); ActiveMQConnectionTimedOutException timedOutSendingPacket(long timeout, Byte type);
@Message(id = 119015, value = "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT) @Message(id = 119015, value = "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT)
ActiveMQDisconnectedException disconnected(); ActiveMQDisconnectedException disconnected();

View File

@ -403,7 +403,7 @@ public final class ChannelImpl implements Channel
if (response == null) if (response == null)
{ {
throw ActiveMQClientMessageBundle.BUNDLE.timedOutSendingPacket(packet.getType()); throw ActiveMQClientMessageBundle.BUNDLE.timedOutSendingPacket(connection.getBlockingCallTimeout(), packet.getType());
} }
if (response.getType() == PacketImpl.EXCEPTION) if (response.getType() == PacketImpl.EXCEPTION)

View File

@ -789,7 +789,6 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
if (conn != null) if (conn != null)
{ {
conn.fail(ActiveMQMessageBundle.BUNDLE.clientExited(conn.getRemoteAddress())); conn.fail(ActiveMQMessageBundle.BUNDLE.clientExited(conn.getRemoteAddress()));
removeConnection(id);
} }
} }

View File

@ -136,7 +136,7 @@ public class ConsumerStuckTest extends ServiceTestBase
long timeStart = System.currentTimeMillis(); long timeStart = System.currentTimeMillis();
while (timeout > System.currentTimeMillis() && server.getSessions().size() != 0 && server.getConnectionCount() != 0) while (timeout > System.currentTimeMillis() && (server.getSessions().size() != 0 || server.getConnectionCount() != 0))
{ {
Thread.sleep(10); Thread.sleep(10);
} }

View File

@ -54,6 +54,7 @@ import org.apache.activemq.core.server.Queue;
import org.apache.activemq.core.server.cluster.impl.BridgeImpl; import org.apache.activemq.core.server.cluster.impl.BridgeImpl;
import org.apache.activemq.core.transaction.impl.TransactionImpl; import org.apache.activemq.core.transaction.impl.TransactionImpl;
import org.apache.activemq.spi.core.protocol.RemotingConnection; import org.apache.activemq.spi.core.protocol.RemotingConnection;
import org.apache.activemq.tests.integration.IntegrationTestLogger;
import org.apache.activemq.tests.util.RandomUtil; import org.apache.activemq.tests.util.RandomUtil;
import org.apache.activemq.tests.util.ServiceTestBase; import org.apache.activemq.tests.util.ServiceTestBase;
import org.apache.activemq.tests.util.UnitTestCase; import org.apache.activemq.tests.util.UnitTestCase;
@ -310,13 +311,13 @@ public class BridgeTest extends ServiceTestBase
ignoreSends && packet instanceof SessionSendLargeMessage || ignoreSends && packet instanceof SessionSendLargeMessage ||
ignoreSends && packet instanceof SessionSendContinuationMessage && !((SessionSendContinuationMessage) packet).isContinues()) ignoreSends && packet instanceof SessionSendContinuationMessage && !((SessionSendContinuationMessage) packet).isContinues())
{ {
System.out.println("Ignored"); IntegrationTestLogger.LOGGER.info("IGNORED: " + packet);
latch.countDown(); latch.countDown();
return false; return false;
} }
else else
{ {
System.out.println(packet); IntegrationTestLogger.LOGGER.info(packet);
return true; return true;
} }
} }
@ -359,9 +360,8 @@ public class BridgeTest extends ServiceTestBase
.setReconnectAttemptsOnSameNode(-1) .setReconnectAttemptsOnSameNode(-1)
.setUseDuplicateDetection(false) .setUseDuplicateDetection(false)
.setConfirmationWindowSize(numMessages * messageSize / 2) .setConfirmationWindowSize(numMessages * messageSize / 2)
.setStaticConnectors(connectorConfig); .setStaticConnectors(connectorConfig)
.setCallTimeout(5000);
bridgeConfiguration.setCallTimeout(500);
List<BridgeConfiguration> bridgeConfigs = new ArrayList<BridgeConfiguration>(); List<BridgeConfiguration> bridgeConfigs = new ArrayList<BridgeConfiguration>();
bridgeConfigs.add(bridgeConfiguration); bridgeConfigs.add(bridgeConfiguration);
@ -423,6 +423,8 @@ public class BridgeTest extends ServiceTestBase
assertTrue("where is the countDown?", myInterceptor.latch.await(30, TimeUnit.SECONDS)); assertTrue("where is the countDown?", myInterceptor.latch.await(30, TimeUnit.SECONDS));
myInterceptor.ignoreSends = false; myInterceptor.ignoreSends = false;
server1.getRemotingService().removeIncomingInterceptor(myInterceptor);
IntegrationTestLogger.LOGGER.info("No longer ignoring packets.");
for (int i = 0; i < numMessages; i++) for (int i = 0; i < numMessages; i++)
{ {