]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Remove a racy test in the AsynchronousHolder unit tests 12905/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 12 Jun 2023 09:04:51 +0000 (11:04 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 12 Jun 2023 09:04:51 +0000 (11:04 +0200)
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)
```

pdns/dnsdistdist/test-dnsdistasync.cc

index 802ba4021d116f43429593e725c8af8d48c4d0bd..b1fbebca053b8b483e523f875ceebfa51614747b 100644 (file)
@@ -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