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 | |
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')
-rw-r--r-- | cpp/test/Ice/background/AllTests.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Ice/location/AllTests.cpp | 7 | ||||
-rw-r--r-- | cpp/test/Ice/timeout/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/udp/AllTests.cpp | 26 |
4 files changed, 27 insertions, 12 deletions
diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp index 1aa19dbefa8..1f2c9e6b6b1 100644 --- a/cpp/test/Ice/background/AllTests.cpp +++ b/cpp/test/Ice/background/AllTests.cpp @@ -245,13 +245,13 @@ void readWriteTests(const ConfigurationPtr&, const Test::BackgroundPrx&, const T BackgroundPrx allTests(const Ice::CommunicatorPtr& communicator) { - string sref = "background:default -p 12010 -t 10000"; + string sref = "background:default -p 12010 -t 20000"; Ice::ObjectPrx obj = communicator->stringToProxy(sref); test(obj); BackgroundPrx background = BackgroundPrx::uncheckedCast(obj); - sref = "backgroundController:tcp -p 12011 -t 10000"; + sref = "backgroundController:tcp -p 12011 -t 20000"; obj = communicator->stringToProxy(sref); test(obj); diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index 5bb637de642..941fb8ef0d5 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -359,7 +359,8 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) catch(const Ice::NotRegisteredException&) { } - test(locator->getRequestCount() > count && locator->getRequestCount() < count + 999); + // Take into account the retries. + test(locator->getRequestCount() > count && locator->getRequestCount() < count + 1999); if(locator->getRequestCount() > count + 800) { cout << "queuing = " << locator->getRequestCount() - count; @@ -522,8 +523,8 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) test(count == locator->getRequestCount()); registry->setAdapterDirectProxy("TestAdapter5", 0); registry->addObject(communicator->stringToProxy("test3:tcp")); - ic->stringToProxy("test@TestAdapter5")->ice_locatorCacheTimeout(1)->ice_ping(); // 1s timeout. - ic->stringToProxy("test3")->ice_locatorCacheTimeout(1)->ice_ping(); // 1s timeout. + ic->stringToProxy("test@TestAdapter5")->ice_locatorCacheTimeout(10)->ice_ping(); // 10s timeout. + ic->stringToProxy("test3")->ice_locatorCacheTimeout(10)->ice_ping(); // 10s timeout. test(count == locator->getRequestCount()); IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1200)); diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp index 63e5a77a1a2..5bfcbd78879 100644 --- a/cpp/test/Ice/timeout/AllTests.cpp +++ b/cpp/test/Ice/timeout/AllTests.cpp @@ -190,7 +190,7 @@ allTests(const Ice::CommunicatorPtr& communicator) // Expect success. // timeout->op(); // Ensure adapter is active. - TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(1000)); + TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_timeout(2000)); try { to->sleep(500); 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) { |