diff options
Diffstat (limited to 'cpp/test/Ice/metrics/AllTests.cpp')
-rw-r--r-- | cpp/test/Ice/metrics/AllTests.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp index c28f9e075da..1524e53f004 100644 --- a/cpp/test/Ice/metrics/AllTests.cpp +++ b/cpp/test/Ice/metrics/AllTests.cpp @@ -695,21 +695,27 @@ allTests(const Ice::CommunicatorPtr& communicator) prx->ice_getConnection()->close(false); - string exceptionName; + bool dnsException = false; try { communicator->stringToProxy("test:tcp -p 12010 -h unknownfoo.zeroc.com")->ice_ping(); test(false); } - catch(const Ice::LocalException& ex) + catch(const Ice::DNSException&) { - exceptionName = ex.ice_name(); + dnsException = true; + } + catch(const Ice::LocalException&) + { + // Some DNS servers don't fail on unknown DNS names. } test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].size() == 2); m1 = clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"][1]; - test(m1->id == "tcp -h unknownfoo.zeroc.com -p 12010" && m1->total == 2 && m1->failures == 2); - - checkFailure(clientMetrics, "EndpointLookup", m1->id, exceptionName, 2); + test(m1->id == "tcp -h unknownfoo.zeroc.com -p 12010" && m1->total == 2 && (!dnsException || m1->failures == 2)); + if(dnsException) + { + checkFailure(clientMetrics, "EndpointLookup", m1->id, "Ice::DNSException", 2); + } c = Connect(prx); |