Author: kwall
Date: Fri Jun 15 18:16:11 2012
New Revision: 1350722
URL: http://svn.apache.org/viewvc?rev=1350722&view=rev
Log:
QPID-4069:
DistributedClientTest.testClientFailsToCreateProducerUsingInvalidSession
occasionally seen to fail on CI
Test is seen to fail on slower CI boxes running persistent profiles. From the
logs, it can be seen that the
issue is timing. Extending receive timeout and sync'ing after the message ought
to resolve the problem.
Modified:
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/ControllerQueue.java
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/DistributedClientTest.java
Modified:
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/ControllerQueue.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/ControllerQueue.java?rev=1350722&r1=1350721&r2=1350722&view=diff
==============================================================================
---
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/ControllerQueue.java
(original)
+++
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/ControllerQueue.java
Fri Jun 15 18:16:11 2012
@@ -66,7 +66,7 @@ public class ControllerQueue
public <T extends Command> T getNext(boolean assertMessageExists) throws
JMSException
{
- final Message message = _controllerQueueMessageConsumer.receive(1000);
+ final Message message = _controllerQueueMessageConsumer.receive(2000);
if(assertMessageExists)
{
Assert.assertNotNull("No message received from control queue",
message);
Modified:
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/DistributedClientTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/DistributedClientTest.java?rev=1350722&r1=1350721&r2=1350722&view=diff
==============================================================================
---
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/DistributedClientTest.java
(original)
+++
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/clientonly/DistributedClientTest.java
Fri Jun 15 18:16:11 2012
@@ -32,6 +32,7 @@ import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
+import org.apache.qpid.client.AMQSession;
import org.apache.qpid.disttest.client.Client;
import org.apache.qpid.disttest.client.ClientState;
import org.apache.qpid.disttest.jms.ClientJmsDelegate;
@@ -158,7 +159,7 @@ public class DistributedClientTest exten
assertState(_client, RUNNING_TEST);
}
- public void testParticipantsSendResults() throws JMSException
+ public void testParticipantsSendResults() throws Exception
{
createTestProducer(TEST_SESSION_NAME, TEST_PRODUCER_NAME,
TEST_DESTINATION);
@@ -204,20 +205,21 @@ public class DistributedClientTest exten
assertState(_client, READY);
}
- private void sendCommandToClient(final Command command) throws JMSException
+ private void sendCommandToClient(final Command command) throws Exception
{
final Message message = JmsMessageAdaptor.commandToMessage(_session,
command);
_clientQueueProducer.send(message);
+ ((AMQSession<?, ?>)_session).sync();
}
- private void sendCommandAndValidateResponse(final Command command, boolean
shouldSucceed) throws JMSException
+ private void sendCommandAndValidateResponse(final Command command, boolean
shouldSucceed) throws Exception
{
sendCommandToClient(command);
Response response = _controllerQueue.getNext();
validateResponse(command.getType(), response, shouldSucceed);
}
- private void sendCommandAndValidateResponse(final Command command) throws
JMSException
+ private void sendCommandAndValidateResponse(final Command command) throws
Exception
{
sendCommandAndValidateResponse(command, true);
}
@@ -258,7 +260,7 @@ public class DistributedClientTest exten
createTestSession(connectionName, sessionName, true);
}
- private void createTestProducer(String sessionName, String producerName,
String destinationName, boolean shouldSucceed) throws JMSException
+ private void createTestProducer(String sessionName, String producerName,
String destinationName, boolean shouldSucceed) throws Exception
{
final CreateProducerCommand createProducerCommand = new
CreateProducerCommand();
createProducerCommand.setParticipantName(producerName);
@@ -269,12 +271,12 @@ public class DistributedClientTest exten
sendCommandAndValidateResponse(createProducerCommand, shouldSucceed);
}
- private void createTestProducer(String sessionName, String producerName,
String destinationName) throws JMSException
+ private void createTestProducer(String sessionName, String producerName,
String destinationName) throws Exception
{
createTestProducer(sessionName, producerName, destinationName, true);
}
- private void createTestConsumer(String sessionName, String consumerName,
String destinationName, boolean shouldSucceed) throws JMSException
+ private void createTestConsumer(String sessionName, String consumerName,
String destinationName, boolean shouldSucceed) throws Exception
{
final CreateConsumerCommand createConsumerCommand = new
CreateConsumerCommand();
createConsumerCommand.setSessionName(sessionName);
@@ -285,7 +287,7 @@ public class DistributedClientTest exten
sendCommandAndValidateResponse(createConsumerCommand, shouldSucceed);
}
- private void createTestConsumer(String sessionName, String consumerName,
String destinationName) throws JMSException
+ private void createTestConsumer(String sessionName, String consumerName,
String destinationName) throws Exception
{
createTestConsumer(sessionName, consumerName, destinationName, true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]