Update tests with 'while True' loop
Some tests use a 'while True' loop to send queries to the DNS server
However, none of them pause between queries, which can lead to high
load on the DNS server.
This patch adds a delay between each query iteration.
Related-Prod: PRODX-57822
Change-Id: I24dcb791f1dde1f26693a118a9ad76776609eca7
(cherry picked from commit 815d3a4113b005951c4b5d2a275c08fbb566f1f8)
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_classless_ptr.py b/designate_tempest_plugin/tests/scenario/v2/test_classless_ptr.py
index a50625f..cca87d9 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_classless_ptr.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_classless_ptr.py
@@ -117,6 +117,8 @@
'Failed, CNAME record was not detected on '
'Nameserver:{} within a timeout of:{}'
' seconds.'.format(ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)
# Check for a PTR record
if config.CONF.dns.nameservers:
@@ -134,6 +136,8 @@
'Failed, PTR record was not detected on '
'Nameserver:{} within a timeout of:{}'
' seconds.'.format(ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)
@decorators.attr(type='slow')
@decorators.idempotent_id('0110e7b1-9582-410e-b3d5-bd38a1265222')
@@ -205,6 +209,8 @@
'Failed, CNAME record was not detected on '
'Nameserver:{} within a timeout of:{}'
' seconds.'.format(ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)
# Check for a PTR record
if config.CONF.dns.nameservers:
@@ -222,3 +228,5 @@
'Failed, PTR record was not detected on '
'Nameserver:{} within a timeout of:{}'
' seconds.'.format(ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
index b93f051..9d955f4 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_recordsets.py
@@ -255,6 +255,8 @@
' detected on Nameserver:{} within a timeout of:{}'
' seconds.'.format(
updated_ttl, ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)
# These tests were unrolled from DDT to allow accurate tracking by
# idempotent_id's. The naming convention for the tests has been preserved.
diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones.py b/designate_tempest_plugin/tests/scenario/v2/test_zones.py
index 11fa653..2761754 100644
--- a/designate_tempest_plugin/tests/scenario/v2/test_zones.py
+++ b/designate_tempest_plugin/tests/scenario/v2/test_zones.py
@@ -241,3 +241,5 @@
' detected on Nameserver:{} within a timeout of:{}'
' seconds.'.format(
new_serial, ns, config.CONF.dns.build_timeout))
+ # To prevent high DNS request rate add some sleep between query
+ time.sleep(1)