]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Add some leeway for the carbon data to reach the test receiver 10544/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 30 Jun 2021 12:48:29 +0000 (14:48 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 30 Jun 2021 12:48:29 +0000 (14:48 +0200)
It seems to fail quite frequently these days, and that gives us two
whole more seconds before timing out, which hopefully should be
enough in most cases.

regression-tests.dnsdist/test_Carbon.py

index 4ee202f6ca898aebff54b708bf139ae33fbfef0d..924abf47ad70a4131cba85ce9c677530eb5e02e4 100644 (file)
@@ -78,12 +78,13 @@ class TestCarbon(DNSDistTest):
         # wait for the carbon data to be sent
         time.sleep(self._carbonInterval + 1)
 
+        # check if the servers have received our data
+        # we will block for a short while if the data is not already there,
+        # and an exception will be raised after the timeout
         # first server
-        self.assertFalse(self._carbonQueue1.empty())
-        data1 = self._carbonQueue1.get(False)
+        data1 = self._carbonQueue1.get(block=True, timeout=2.0)
         # second server
-        self.assertFalse(self._carbonQueue2.empty())
-        data2 = self._carbonQueue2.get(False)
+        data2 = self._carbonQueue2.get(block=True, timeout=2.0)
         after = time.time()
 
         self.assertTrue(data1)
@@ -120,12 +121,13 @@ class TestCarbon(DNSDistTest):
         # wait for the carbon data to be sent
         time.sleep(self._carbonInterval + 1)
 
+        # check if the servers have received our data
+        # we will block for a short while if the data is not already there,
+        # and an exception will be raised after the timeout
         # first server
-        self.assertFalse(self._carbonQueue1.empty())
-        data1 = self._carbonQueue1.get(False)
+        data1 = self._carbonQueue1.get(block=True, timeout=2.0)
         # second server
-        self.assertFalse(self._carbonQueue2.empty())
-        data2 = self._carbonQueue2.get(False)
+        data2 = self._carbonQueue2.get(block=True, timeout=2.0)
         after = time.time()
 
         # check the first carbon server got both servers and