Skip to content

Commit b3c0734

Browse files
Add test for DNS resolution error handling
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 283802d commit b3c0734

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

unit_tests/sources/streams/http/test_http.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ def test_raise_on_http_errors(mocker, error):
331331
assert send_mock.call_count == stream.max_retries + 1
332332

333333

334+
def test_dns_resolution_error_retry():
335+
"""Test that DNS resolution errors are retried"""
336+
stream = StubBasicReadHttpStream()
337+
error_handler = stream.get_error_handler()
338+
resolution = error_handler.interpret_response(requests.exceptions.InvalidURL())
339+
340+
assert resolution.response_action == ResponseAction.RETRY
341+
assert resolution.failure_type == FailureType.transient_error
342+
343+
334344
class PostHttpStream(StubBasicReadHttpStream):
335345
http_method = "POST"
336346

0 commit comments

Comments
 (0)