Skip to content

Commit a0af1e2

Browse files
committed
Increase the timeout to allow statistics to sync up
1 parent fb8a1bc commit a0af1e2

1 file changed

Lines changed: 5 additions & 25 deletions

File tree

activemq-unit-tests/src/test/java/org/apache/activemq/network/NetworkAdvancedStatisticsTest.java

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected String getLocalBrokerURI() {
110110
}
111111

112112
//Added for AMQ-9437 test advancedStatistics for networkEnqueue and networkDequeue
113-
@Test(timeout = 60 * 1000)
113+
@Test(timeout = 120 * 1000)
114114
public void testNetworkAdvancedStatistics() throws Exception {
115115

116116
// create a remote durable consumer to create demand
@@ -159,13 +159,11 @@ public boolean isSatisified() throws Exception {
159159
// The number of message that remain is due to the exclude queue
160160
return receivedMessages.size() == MESSAGE_COUNT;
161161
}
162-
}, 10000, 500));
162+
}, 30000, 500));
163163

164164
assertTrue(receivedExceptions.isEmpty());
165165
assertEquals(Integer.valueOf(MESSAGE_COUNT), Integer.valueOf(receivedMessages.size()));
166166

167-
waitForIncludedStatsToUpdate();
168-
169167
//Make sure stats are correct for local -> remote
170168
assertEquals(MESSAGE_COUNT, localBroker.getDestination(includedDestination).getDestinationStatistics().getEnqueues().getCount());
171169
assertEquals(MESSAGE_COUNT, localBroker.getDestination(includedDestination).getDestinationStatistics().getDequeues().getCount());
@@ -238,37 +236,19 @@ public boolean isSatisified() throws Exception {
238236
public boolean isSatisified() throws Exception {
239237
return localBroker.getSystemUsage().getMemoryUsage().getUsage() == 0;
240238
}
241-
}, 10000, 500));
239+
}, 30000, 500));
242240
} else {
243241
assertTrue(Wait.waitFor(new Condition() {
244242
@Override
245243
public boolean isSatisified() throws Exception {
246244
// The number of message that remain is due to the exclude queue
247245
return localBroker.getAdminView().getTotalMessageCount() == MESSAGE_COUNT;
248246
}
249-
}, 10000, 500));
247+
}, 30000, 500));
250248
}
251249
remoteConsumer.close();
252250
}
253251

254-
private void waitForIncludedStatsToUpdate() throws Exception {
255-
assertTrue("Included destination stats did not reach expected counts",
256-
Wait.waitFor(new Condition() {
257-
@Override
258-
public boolean isSatisified() throws Exception {
259-
return MESSAGE_COUNT == localBroker.getDestination(includedDestination).getDestinationStatistics().getEnqueues().getCount()
260-
&& MESSAGE_COUNT == localBroker.getDestination(includedDestination).getDestinationStatistics().getDequeues().getCount()
261-
&& MESSAGE_COUNT == localBroker.getDestination(includedDestination).getDestinationStatistics().getForwards().getCount()
262-
&& MESSAGE_COUNT == localBroker.getDestination(includedDestination).getDestinationStatistics().getNetworkDequeues().getCount()
263-
&& 0 == localBroker.getDestination(includedDestination).getDestinationStatistics().getNetworkEnqueues().getCount()
264-
&& MESSAGE_COUNT == remoteBroker.getDestination(includedDestination).getDestinationStatistics().getEnqueues().getCount()
265-
&& 0 == remoteBroker.getDestination(includedDestination).getDestinationStatistics().getForwards().getCount()
266-
&& MESSAGE_COUNT == remoteBroker.getDestination(includedDestination).getDestinationStatistics().getNetworkEnqueues().getCount()
267-
&& 0 == remoteBroker.getDestination(includedDestination).getDestinationStatistics().getNetworkDequeues().getCount();
268-
}
269-
}, 20000, 500));
270-
}
271-
272252
protected void assertNetworkBridgeStatistics(final long expectedLocalSent, final long expectedRemoteSent) throws Exception {
273253

274254
final NetworkBridge localBridge = localBroker.getNetworkConnectors().get(0).activeBridges().iterator().next();
@@ -285,4 +265,4 @@ public boolean isSatisified() throws Exception {
285265
}));
286266
}
287267

288-
}
268+
}

0 commit comments

Comments
 (0)