-
1. Re: ConsumerTest Hudson intermittent failure
clebert.suconic Dec 8, 2008 10:43 PM (in response to timfox)I thought it was failing because of asynchronous calls to ACK, but I made a change and still fails.
One way to easily replicate this is doing this:org.jboss.messaging.tests.integration.consumer.ConsumerTest public void testConsumerAckImmediateAckIgnored() throws Exception { for (int i = 0; i < 100; i++) { internaltestConsumerAckImmediateAckIgnored(); tearDown(); setUp(); } } private void internaltestConsumerAckImmediateAckIgnored() throws Exception { ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory")); sf.setBlockOnAcknowledge(true); sf.setBlockOnNonPersistentSend(true); sf.setBlockOnPersistentSend(true);
-
2. Re: ConsumerTest Hudson intermittent failure
clebert.suconic Dec 8, 2008 10:45 PM (in response to timfox)One very minor thing on that test,
assertEquals(0, result);
... the first parameter should aways be the expected value, and the second the result. -
3. Re: ConsumerTest Hudson intermittent failure
timfox Dec 9, 2008 3:52 AM (in response to timfox)I think it's a very simple problem:
The test assertion is invalid:assertEquals(0, messagingService.getServer().getPostOffice().getBinding(QUEUE).getQueue().getDeliveringCount());
Delivering count is incremented in the queue *after* the message is delivered:HandleStatus status = distributionPolicy.distribute(reference); if (status == HandleStatus.HANDLED) { deliveringCount.incrementAndGet(); return HandleStatus.HANDLED; }
So, depending on thread scheduling the consumer could receive the message before delivering count gets incremented, in which case it would see the value -1, because the message is actually acked and delivering count decremented *before* it's incremented. -
4. Re: ConsumerTest Hudson intermittent failure
timfox Dec 9, 2008 3:53 AM (in response to timfox)To make the test assertion valid we'd have to make sure deliveringcount was incremented in the queue *before* the message reference was given to the server consumer for delivery.
-
5. Re: ConsumerTest Hudson intermittent failure
timfox Dec 10, 2008 4:52 AM (in response to timfox)If this can't be fixed straight away, please add a JIRA for it.
-
6. Re: ConsumerTest Hudson intermittent failure
timfox Dec 10, 2008 8:47 AM (in response to timfox)Ok I'll do it then:
https://jira.jboss.org/jira/browse/JBMESSAGING-1465 -
7. Re: ConsumerTest Hudson intermittent failure
ataylor Dec 10, 2008 8:55 AM (in response to timfox)will do
-
8. Re: ConsumerTest Hudson intermittent failure
ataylor Dec 11, 2008 9:09 AM (in response to timfox)Ive added a method to queue:referenceHandled() that increments the delivery count. The consumer calls this before it sends each message.