mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-13 14:30:03 -04:00
Merge branch '4139-test_send_timeout-check-can-be-unstable' into 'main'
Make the test_send_timeout check more stable Closes #4139 See merge request isc-projects/bind9!8168
This commit is contained in:
commit
4970d0ca38
2 changed files with 19 additions and 0 deletions
|
|
@ -40,3 +40,21 @@ have_libxml2 = pytest.mark.skipif(
|
|||
have_json_c = pytest.mark.skipif(
|
||||
not feature_test("--have-json-c"), reason="json-c support disabled in the build"
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
import flaky as flaky_pkg
|
||||
except ModuleNotFoundError:
|
||||
# In case the flaky package is not installed, run the tests as usual
|
||||
# without any attempts to re-run them.
|
||||
# pylint: disable=unused-argument
|
||||
def flaky(*args, **kwargs):
|
||||
"""Mock decorator that doesn't do anything special, just returns the function."""
|
||||
|
||||
def wrapper(wrapped_obj):
|
||||
return wrapped_obj
|
||||
|
||||
return wrapper
|
||||
|
||||
else:
|
||||
flaky = flaky_pkg.flaky
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ def test_long_axfr(named_port):
|
|||
assert soa is not None
|
||||
|
||||
|
||||
@pytest_custom_markers.flaky(max_runs=3)
|
||||
def test_send_timeout(named_port):
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
sock.connect(("10.53.0.1", named_port))
|
||||
|
|
|
|||
Loading…
Reference in a new issue