From 86490903b5bdab38c5569709208622ec72b0121b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= Date: Tue, 7 May 2024 16:41:42 +0200 Subject: [PATCH] tests/pytests/utils: handle SSLEOFError It used to just throw BrokenPipeError, but newer versions of Python have a separate exception for when the connection is closed in violation of TLS rules, which Knot Resolver does deliberately so as to not waste time on properly closing TLS connections with misbehaving peers. --- tests/pytests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytests/utils.py b/tests/pytests/utils.py index 7792c047c..8af71aadf 100644 --- a/tests/pytests/utils.py +++ b/tests/pytests/utils.py @@ -99,7 +99,7 @@ def ping_alive(sock, msgid=None): @contextmanager def expect_kresd_close(rst_ok=False): - with pytest.raises(BrokenPipeError): + with pytest.raises((BrokenPipeError, ssl.SSLEOFError)): try: time.sleep(0.2) # give kresd time to close connection with TCP FIN yield -- 2.47.2