From f556fbebb6a97dd655208cc4fb84d3e6decfbb1a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 10 Apr 2019 14:12:23 +0200 Subject: [PATCH] Use a smaller test size to not fill the pipe buffer on systems with a small one. Also, explictly set arguments to avoid order dependencies and make it possible to run single tests. --- pdns/test-distributor_hh.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pdns/test-distributor_hh.cc b/pdns/test-distributor_hh.cc index 63ae49d3a1..06c74dbffa 100644 --- a/pdns/test-distributor_hh.cc +++ b/pdns/test-distributor_hh.cc @@ -68,11 +68,17 @@ struct BackendSlow BOOST_AUTO_TEST_CASE(test_distributor_queue) { + ::arg().set("overload-queue-length","Maximum queuelength moving to packetcache only")="0"; + ::arg().set("max-queue-length","Maximum queuelength before considering situation lost")="1000"; + ::arg().set("queue-limit","Maximum number of milliseconds to queue a query")="1500"; + S.declare("servfail-packets","Number of times a server-failed packet was sent out"); + S.declare("timedout-packets", "timedout-packets"); + auto d=Distributor::Create(2); BOOST_CHECK_EXCEPTION( { int n; - for(n=0; n < 6000; ++n) { + for(n=0; n < 2000; ++n) { auto q = new Question(); q->d_dt.set(); d->question(q, report); @@ -115,6 +121,12 @@ static void report2(DNSPacket* A) BOOST_AUTO_TEST_CASE(test_distributor_dies) { + ::arg().set("overload-queue-length","Maximum queuelength moving to packetcache only")="0"; + ::arg().set("max-queue-length","Maximum queuelength before considering situation lost")="5000"; + ::arg().set("queue-limit","Maximum number of milliseconds to queue a query")="1500"; + S.declare("servfail-packets","Number of times a server-failed packet was sent out"); + S.declare("timedout-packets", "timedout-packets"); + auto d=Distributor::Create(10); sleep(1); g_receivedAnswers=0; -- 2.47.2