[
https://issues.apache.org/jira/browse/CAMEL-12852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636661#comment-16636661
]
ASF GitHub Bot commented on CAMEL-12852:
----------------------------------------
GitHub user apupier opened a pull request:
https://github.com/apache/camel/pull/2548
CAMEL-12852 - use minimum expected message count
a lot of messages are generated, only the first oen is checked.
please check comments on https://issues.apache.org/jira/browse/CAMEL-12852
this PR is in case the tested routes is expected to generate several
messages. If it is not normal, the fix will need to be different.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apupier/camel
CAMEL-12852-useMinimumMessageCount
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2548.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2548
----
commit 41b52a131356981f7260a7d9c14d3c770390f894
Author: Aurélien Pupier <apupier@...>
Date: 2018-10-03T09:16:10Z
CAMEL-12852 - use minimum expected message count
a lot of messages are generated, only the first oen is checked.
Signed-off-by: Aurélien Pupier <[email protected]>
----
> Fix unstable test PubNubPresenceTest
> ------------------------------------
>
> Key: CAMEL-12852
> URL: https://issues.apache.org/jira/browse/CAMEL-12852
> Project: Camel
> Issue Type: Bug
> Reporter: Aurélien Pupier
> Priority: Major
>
> sometimes it is failing with
> https://fusesource-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/camel.redhat.pipeline/job/2.21.x.redhat-7-0-x/18/testReport/junit/org.apache.camel.component.pubnub/PubNubPresenceTest/testPresence/
> {quote}Error Message
> mock://result Received message count. Expected: <1> but was: <2>
> Stacktrace
> java.lang.AssertionError: mock://result Received message count. Expected: <1>
> but was: <2>
> at
> org.apache.camel.component.pubnub.PubNubPresenceTest.testPresence(PubNubPresenceTest.java:53){quote}
> the problem is that in fact a lot of exchanges are created.
> In org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(long), it
> is waiting to reach at least the given expected number in the provided
> timeout.
> As soon as it is reached, it is doing the assertion.
> But between the assertion done in the line just after, a new message may
> arrive.
> You can notice it by putting a Thread.sleep(1000) fo rinstance before the
> assertEquals, with PubNubTest it wil lalways fail and there will be a lo
> tmore messages.
> So 2 possibilities:
> - the test should expect a minimum number of messages
> - the route used in test should be modified to trigger a single message
> - the camel product should not create several messages and in this case it is
> a product bug
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)