From e8f6b7cd234088e7c33e42eb10e29719ea8e8aa9 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 3 Sep 2008 03:21:00 +0000 Subject: Cluster multicasts buffers rather than frames. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@691489 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/.valgrind.supp | 7 ++++--- cpp/src/tests/ForkedBroker.h | 5 ++++- cpp/src/tests/cluster_test.cpp | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'cpp/src/tests') diff --git a/cpp/src/tests/.valgrind.supp b/cpp/src/tests/.valgrind.supp index dd8f7536a1..3b1fd2198a 100644 --- a/cpp/src/tests/.valgrind.supp +++ b/cpp/src/tests/.valgrind.supp @@ -193,9 +193,10 @@ } { - CPG related errors - seem benign but should invesgitate. + CPG error - seems benign. Memcheck:Param socketcall.sendmsg(msg.msg_iov[i]) - fun:sendmsg - obj:/usr/lib/openais/libcpg.so.2.0.0 + obj:* + obj:*/libcpg.so.2.0.0 } + diff --git a/cpp/src/tests/ForkedBroker.h b/cpp/src/tests/ForkedBroker.h index 07e69a0735..cc8714bf23 100644 --- a/cpp/src/tests/ForkedBroker.h +++ b/cpp/src/tests/ForkedBroker.h @@ -85,7 +85,10 @@ class ForkedBroker { ::close(pipeFds[1]); FILE* f = ::fdopen(pipeFds[0], "r"); if (!f) throw ErrnoException("fopen failed"); - if (::fscanf(f, "%d", &port) != 1) throw ErrnoException("ill-formatted port"); + if (::fscanf(f, "%d", &port) != 1) { + if (ferror(f)) throw ErrnoException("Error reading port number from child."); + else throw qpid::Exception("EOF reading port number from child."); + } } else { // child ::close(pipeFds[0]); diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp index 3f09143fff..9abc1b189e 100644 --- a/cpp/src/tests/cluster_test.cpp +++ b/cpp/src/tests/cluster_test.cpp @@ -27,6 +27,7 @@ #include "qpid/client/Connection.h" #include "qpid/client/Session.h" #include "qpid/framing/Uuid.h" +#include "qpid/log/Logger.h" #include #include @@ -87,7 +88,7 @@ ClusterFixture::ClusterFixture(size_t n) : name(Uuid(true).str()) { void ClusterFixture::add() { std::ostringstream os; - os << "broker" << size(); + os << "fork" << size(); std::string prefix = os.str(); const char* argv[] = { @@ -105,6 +106,7 @@ void ClusterFixture::add() { } else { // First broker, run in this process. Broker::Options opts; + qpid::log::Logger::instance().setPrefix("main"); Plugin::addOptions(opts); // Pick up cluster options. opts.parse(argc, argv, "", true); // Allow-unknown for --load-module broker0.reset(new BrokerFixture(opts)); @@ -144,7 +146,8 @@ QPID_AUTO_TEST_CASE(testSingletonCluster) { ClusterFixture cluster(1); Client c(cluster[0]); BOOST_CHECK(c.session.queueQuery("q").getQueue().empty()); - BOOST_CHECK(c.session.exchangeQuery("ex").getType().empty()); + BOOST_CHECK(c.session.exchangeQuery("ex").getType().empty()); + // FIXME aconway 2008-09-01: leaks if aisexec not running, investigate. } QPID_AUTO_TEST_CASE(testWiringReplication) { -- cgit v1.2.1