Fix timing problem on UDP test case (send before ready to receive)

This commit is contained in:
Gary Russell
2010-05-28 21:56:22 +00:00
parent 8119caa249
commit f6ac5c61bb
2 changed files with 11 additions and 1 deletions

View File

@@ -116,6 +116,16 @@ public class UdpUnicastEndToEndTests implements Runnable {
public void run() {
AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
"testIp-in-context.xml", UdpUnicastEndToEndTests.class);
UnicastReceivingChannelAdapter inbound = ctx.getBean(UnicastReceivingChannelAdapter.class);
int n = 0;
try {
while (!inbound.isListening()) {
Thread.sleep(100);
if (n++ > 100) {
throw new RuntimeException("Failed to start listening");
}
}
} catch (Exception e) { }
while (okToRun) {
try {
readyToReceive.countDown();

View File

@@ -35,7 +35,7 @@
acknowledge="true"
ack-host="localhost"
ack-port="22222"
ack-timeout="2000"
ack-timeout="10000"
channel="outputChannel"/>
<beans:import resource="testIp-common-context.xml" />