]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use a smaller test size to not fill the pipe buffer on systems with a small one.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Apr 2019 12:12:23 +0000 (14:12 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Apr 2019 12:12:23 +0000 (14:12 +0200)
Also, explictly set arguments to avoid order dependencies and make it possible
to run single tests.

pdns/test-distributor_hh.cc

index 63ae49d3a15e39e870b059ed2c882e78cfcfe16a..06c74dbffab01fc81278b13794823b667ac09685 100644 (file)
@@ -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<DNSPacket, Question, BackendSlow>::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<DNSPacket, Question, BackendDies>::Create(10);
   sleep(1);
   g_receivedAnswers=0;