diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-03-13 15:48:48 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-03-13 15:48:48 +0100 |
commit | 6100dbec3982b80c6fe88cff15be24f44e5fa1ad (patch) | |
tree | caea870ac8d428e0e1948e78733f476ae643a6f2 /cpp/test/Ice/udp/AllTests.cpp | |
parent | minor formatting tweaks to protobuf demo README (diff) | |
download | ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.tar.bz2 ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.tar.xz ice-6100dbec3982b80c6fe88cff15be24f44e5fa1ad.zip |
Fixed for bug 3830, 3866, 3857 - CHANGES fixes, test/Ice/timeout and udp failures, also committed minor fixes to other tests to better handle slow machines
Diffstat (limited to 'cpp/test/Ice/udp/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/udp/AllTests.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp index 2965004ec56..61d5f5efbe0 100644 --- a/cpp/test/Ice/udp/AllTests.cpp +++ b/cpp/test/Ice/udp/AllTests.cpp @@ -73,12 +73,26 @@ allTests(const CommunicatorPtr& communicator) ObjectPrx base = communicator->stringToProxy("test:udp -p 12010")->ice_datagram(); TestIntfPrx obj = TestIntfPrx::uncheckedCast(base); - replyI->reset(); - obj->ping(reply); - obj->ping(reply); - obj->ping(reply); - bool ret = replyI->waitReply(3, IceUtil::Time::seconds(2)); - test(ret == true); + int nRetry = 5; + bool ret; + while(nRetry-- > 0) + { + replyI->reset(); + obj->ping(reply); + obj->ping(reply); + obj->ping(reply); + ret = replyI->waitReply(3, IceUtil::Time::seconds(2)); + if(ret) + { + break; // Success + } + + // If the 3 datagrams were not received within the 2 seconds, we try again to + // receive 3 new datagrams using a new object. We give up after 5 retries. + replyI = new PingReplyI; + reply = PingReplyPrx::uncheckedCast(adapter->addWithUUID(replyI))->ice_datagram(); + } + test(ret); if(communicator->getProperties()->getPropertyAsInt("Ice.Override.Compress") == 0) { |