From: Otto Moerbeek Date: Wed, 22 Mar 2023 09:53:00 +0000 (+0100) Subject: Another case of a test calling the API before it is ready X-Git-Tag: rec-4.9.0-alpha1~7^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f20bacd270aa18c16be21d3d5d94cb1f48950478;p=thirdparty%2Fpdns.git Another case of a test calling the API before it is ready --- diff --git a/regression-tests.recursor-dnssec/test_PacketCache.py b/regression-tests.recursor-dnssec/test_PacketCache.py index 80b015f6f9..ba8c102ddd 100644 --- a/regression-tests.recursor-dnssec/test_PacketCache.py +++ b/regression-tests.recursor-dnssec/test_PacketCache.py @@ -47,6 +47,7 @@ f 3600 IN CNAME f ; CNAME loop: dirty trick to get a ServFail in an a super(PacketCacheRecursorTest, cls).generateRecursorConfig(confdir) def checkPacketCacheMetrics(self, expectedHits, expectedMisses): + self.waitForTCPSocket("127.0.0.1", self._wsPort) headers = {'x-api-key': self._apiKey} url = 'http://127.0.0.1:' + str(self._wsPort) + '/api/v1/servers/localhost/statistics' r = requests.get(url, headers=headers, timeout=self._wsTimeout)