]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: make valgrind build and testrunner run work again 14801/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 25 Oct 2024 12:49:04 +0000 (14:49 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 25 Oct 2024 13:49:54 +0000 (15:49 +0200)
The testrunner run becomes very slow, a non-zero inception skew is needed.

pdns/recursordist/mtasker.hh
pdns/recursordist/test-rec-tcounters_cc.cc
pdns/recursordist/test-syncres_cc.cc

index a45f64d8326b75d6627bd5d9612a731fd8b64532..f51ede3b33c97cb2fc25aded5743c8ef21b2eaa1 100644 (file)
@@ -373,8 +373,7 @@ std::shared_ptr<pdns_ucontext_t> MTasker<Key, Val, Cmp>::getUContext()
   ucontext->uc_link = &d_kernel; // come back to kernel after dying
 
 #ifdef PDNS_USE_VALGRIND
-  uc->valgrind_id = VALGRIND_STACK_REGISTER(&uc->uc_stack[0],
-                                            &uc->uc_stack[uc->uc_stack.size() - 1]);
+  ucontext->valgrind_id = VALGRIND_STACK_REGISTER(&ucontext->uc_stack[0], &ucontext->uc_stack[ucontext->uc_stack.size() - 1]);
 #endif /* PDNS_USE_VALGRIND */
 
   return ucontext;
index 82faf5343096c271becb2927d583babe1280c57d..f77d5b297c21593164f4f771296e8acfaea4f0bc 100644 (file)
@@ -76,6 +76,7 @@ BOOST_AUTO_TEST_CASE(update_fast)
       BOOST_CHECK_EQUAL(counts.uint64Count[0], counts.uint64Count[1]);
       auto avg = counts.at(rec::DoubleWAvgCounter::avgLatencyUsec).avg;
       BOOST_CHECK(avg == 0.0 || (avg >= 1.1 && avg <= 2.2));
+      std::this_thread::yield(); // needed, as otherwise the updates to done might not be spotted under valgrind
     }
   });
   thread1.join();
index 94d3ff6e435607eaea5c0e5034a362f58b1bd3c8..49d593503dbfd91119c24e4c7f5e97c5f2afdf4f 100644 (file)
@@ -215,6 +215,7 @@ void initSR(bool debug)
 
   g_dnssecmode = DNSSECMode::Off;
   g_maxNSEC3Iterations = 2500;
+  g_signatureInceptionSkew = 60;
 
   g_aggressiveNSECCache.reset();
   AggressiveNSECCache::s_maxNSEC3CommonPrefix = AggressiveNSECCache::s_default_maxNSEC3CommonPrefix;