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:
Gary Tully 2009-09-16 09:20:50 +00:00
parent da6809ced3
commit 5f2abc13c8
1 changed files with 3 additions and 4 deletions

View File

@ -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);