mirror of https://github.com/apache/activemq.git
resolve intermittent failure of test for https://issues.apache.org/activemq/browse/AMQ-1687 - wait for messages needs to wait for the outstanding count rather than just 10
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@815684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
da6809ced3
commit
5f2abc13c8
|
@ -100,11 +100,10 @@ public class ConsumerBean extends Assert implements MessageListener {
|
|||
* @param messageCount
|
||||
*/
|
||||
public void waitForMessagesToArrive(int messageCount) {
|
||||
LOG.info("Waiting for message to arrive");
|
||||
|
||||
final long maxRemainingMessageCount = Math.max(0, messageCount - messages.size());
|
||||
LOG.info("Waiting for (" + maxRemainingMessageCount + ") message(s) to arrive");
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (int i = 0; i < maxRemainingMessageCount; i++) {
|
||||
try {
|
||||
synchronized (semaphore) {
|
||||
semaphore.wait(1000);
|
||||
|
|
Loading…
Reference in New Issue