From: Otto Moerbeek Date: Tue, 12 Sep 2023 09:14:16 +0000 (+0200) Subject: Introduce randomness in test order to catch hidden dependencies between unit-tests X-Git-Tag: rec-5.0.0-alpha1~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6311767375aaeff2f9f06142348ede3c7fc53246;p=thirdparty%2Fpdns.git Introduce randomness in test order to catch hidden dependencies between unit-tests Also be a bit more lenient in a recently introduced test that checks timing of some aggressive cache manipulations. --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index cb9e538f7f..b5eef7a544 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1514,7 +1514,7 @@ noinst_PROGRAMS = speedtest if UNIT_TESTS noinst_PROGRAMS += testrunner if HAVE_BOOST_GE_148 -TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)' +TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message BOOST_TEST_RANDOM=1 SRCDIR='$(srcdir)' TESTS=testrunner else check-local: diff --git a/pdns/dnsdistdist/Makefile.am b/pdns/dnsdistdist/Makefile.am index c39015d50f..ee14af84b8 100644 --- a/pdns/dnsdistdist/Makefile.am +++ b/pdns/dnsdistdist/Makefile.am @@ -119,7 +119,7 @@ bin_PROGRAMS = dnsdist if UNIT_TESTS noinst_PROGRAMS = testrunner -TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)' +TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message BOOST_TEST_RANDOM=1 SRCDIR='$(srcdir)' TESTS=testrunner else check-local: diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index fc330b3c6d..6045315575 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -91,7 +91,7 @@ TESTS=test_libcrypto if UNIT_TESTS noinst_PROGRAMS = testrunner -TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)' +TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message BOOST_TEST_RANDOM=1 SRCDIR='$(srcdir)' TESTS += testrunner else check-local: diff --git a/pdns/recursordist/test-aggressive_nsec_cc.cc b/pdns/recursordist/test-aggressive_nsec_cc.cc index 1809deea23..d62b146b9e 100644 --- a/pdns/recursordist/test-aggressive_nsec_cc.cc +++ b/pdns/recursordist/test-aggressive_nsec_cc.cc @@ -1121,7 +1121,7 @@ BOOST_AUTO_TEST_CASE(test_aggressive_nsec_replace) auto diff2 = time.udiff(true); // Check that replace is about equally fast as insert - BOOST_CHECK(diff1 < diff2 * 1.2 && diff2 < diff1 * 1.2); + BOOST_CHECK(diff1 < diff2 * 1.3 && diff2 < diff1 * 1.3); } BOOST_AUTO_TEST_CASE(test_aggressive_nsec_wiping)