summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/BrokerFixture.h2
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp17
2 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/tests/BrokerFixture.h b/cpp/src/tests/BrokerFixture.h
index 76cf2e8761..1a397c76c8 100644
--- a/cpp/src/tests/BrokerFixture.h
+++ b/cpp/src/tests/BrokerFixture.h
@@ -43,6 +43,8 @@ struct BrokerFixture {
BrokerFixture() {
Broker::Options opts;
opts.port=0;
+ // Management doesn't play well with multiple in-process brokers.
+ opts.enableMgmt=false;
opts.workerThreads=1;
broker = Broker::create(opts);
// TODO aconway 2007-12-05: At one point BrokerFixture
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index f9de3b7619..60cfe04510 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -167,5 +167,22 @@ BOOST_FIXTURE_TEST_CASE(testSuspendResume, ClientSessionFixture)
BOOST_CHECK_EQUAL(string("my-message"), msg->getContent());
}
+BOOST_FIXTURE_TEST_CASE(testSendToSelf, SessionFixture) {
+ // https://bugzilla.redhat.com/show_bug.cgi?id=410551
+ // Deadlock if SubscriptionManager run() concurrent with session ack.
+ LocalQueue myq;
+ session.queueDeclare(queue="myq", exclusive=true, autoDelete=true);
+ subs.subscribe(myq, "myq");
+ string data("msg");
+ Message msg(data, "myq");
+ const int count=100; // Verified with count=100000 in a loop.
+ for (int i = 0; i < count; ++i)
+ session.messageTransfer(content=msg);
+ for (int j = 0; j < count; ++j) {
+ Message m=myq.pop();
+ BOOST_CHECK_EQUAL(m.getData(), data);
+ }
+}
+
QPID_AUTO_TEST_SUITE_END()