From: Otto Moerbeek Date: Wed, 10 Apr 2019 12:12:23 +0000 (+0200) Subject: Use a smaller test size to not fill the pipe buffer on systems with a small one. X-Git-Tag: dnsdist-1.4.0-alpha2~17^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f556fbebb6a97dd655208cc4fb84d3e6decfbb1a;p=thirdparty%2Fpdns.git 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. --- 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;