diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/test/IceGrid/activation/AllTests.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/cpp/test/IceGrid/activation/AllTests.cpp b/cpp/test/IceGrid/activation/AllTests.cpp index 7eb967f9b82..8429b33d9e1 100644 --- a/cpp/test/IceGrid/activation/AllTests.cpp +++ b/cpp/test/IceGrid/activation/AllTests.cpp @@ -622,17 +622,23 @@ allTests(Test::TestHelper* helper) try { test(admin->getServerState("server2") == IceGrid::Inactive); - TestIntfPrx obj = TestIntfPrx::checkedCast(communicator->stringToProxy("server2")); - waitForServerState(admin, "server2", IceGrid::Active); - obj->fail(); - waitForServerState(admin, "server2", IceGrid::Inactive); - try + TestIntfPrx obj = TestIntfPrx::uncheckedCast(communicator->stringToProxy("server2")); + while(true) { obj->ice_ping(); - test(false); - } - catch(const Ice::NoEndpointException&) - { + waitForServerState(admin, "server2", IceGrid::Active); + IceUtil::Time now = IceUtil::Time::now(); + obj->fail(); + waitForServerState(admin, "server2", IceGrid::Inactive); + try + { + obj->ice_ping(); + test(IceUtil::Time::now() - now >= IceUtil::Time::seconds(2)); + } + catch(const Ice::NoEndpointException&) + { + break; // Success + } } test(!admin->isServerEnabled("server2")); nRetry = 0; |