From cf8ae7bba793a10382b3a904363d94525147d9cb Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 30 Jun 2021 14:48:29 +0200 Subject: [PATCH] dnsdist: Add some leeway for the carbon data to reach the test receiver 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 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/regression-tests.dnsdist/test_Carbon.py b/regression-tests.dnsdist/test_Carbon.py index 4ee202f6ca..924abf47ad 100644 --- a/regression-tests.dnsdist/test_Carbon.py +++ b/regression-tests.dnsdist/test_Carbon.py @@ -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 -- 2.47.2