summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-11-29 17:00:45 +0100
committerBenoit Foucher <benoit@zeroc.com>2012-11-29 17:00:45 +0100
commit80f46d89c959963ed69e905e46e64f942b6e236e (patch)
tree6ffaa84555032d524c18ca733d01b0ce6bf1b702 /cpp
parentFixed ICE-5036 - Ice metrics test failure (diff)
downloadice-80f46d89c959963ed69e905e46e64f942b6e236e.tar.bz2
ice-80f46d89c959963ed69e905e46e64f942b6e236e.tar.xz
ice-80f46d89c959963ed69e905e46e64f942b6e236e.zip
Better fix for ICE-5036 - Ice metrics test failure
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/Ice/metrics/AllTests.cpp18
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);