From: Remi Gacogne Date: Mon, 12 Jun 2023 09:04:51 +0000 (+0200) Subject: dnsdist: Remove a racy test in the AsynchronousHolder unit tests X-Git-Tag: rec-4.10.0-alpha0~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12905%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Remove a racy test in the AsynchronousHolder unit tests We are adding an expired event so the worker thread of the AsynchronousHolder can pick it up immediately, even before we come back from the call to push(), which leads to a racy test. This was observed on GitHub Actions when running with TSAN: ``` FAIL: testrunner ================ Running 170 test cases... test-dnsdistasync.cc(156): error: in "test_dnsdistasync/test_AddingExpiredEvent": check !holder->empty() has failed *** 1 failure is detected in the test module "unit" FAIL testrunner (exit status: 201) ``` --- diff --git a/pdns/dnsdistdist/test-dnsdistasync.cc b/pdns/dnsdistdist/test-dnsdistasync.cc index 802ba4021d..b1fbebca05 100644 --- a/pdns/dnsdistdist/test-dnsdistasync.cc +++ b/pdns/dnsdistdist/test-dnsdistasync.cc @@ -153,7 +153,6 @@ BOOST_AUTO_TEST_CASE(test_AddingExpiredEvent) sender = query->d_sender; BOOST_REQUIRE(sender != nullptr); holder->push(asyncID, queryID, ttd, std::move(query)); - BOOST_CHECK(!holder->empty()); } // sleep for 20 ms