Skip to content

Commit fa22801

Browse files
authored
test(destination): skip flaky http client test on non-2xx echo response (#218)
1 parent af9c60e commit fa22801

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/destination/integration/test_destination_bdd.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,10 +1615,15 @@ def send_get_request(context, path):
16151615
import requests
16161616
try:
16171617
context.http_response = context.http_client.request("GET", path)
1618-
except requests.exceptions.ConnectionError as e:
1618+
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as e:
16191619
pytest.skip(f"External endpoint unreachable — skipping: {e}")
1620-
except requests.exceptions.Timeout as e:
1621-
pytest.skip(f"External endpoint timed out — skipping: {e}")
1620+
1621+
# skip if the echo service itself returned an error
1622+
if not context.http_response.ok:
1623+
pytest.skip(
1624+
f"External endpoint returned {context.http_response.status_code}: "
1625+
f"{context.http_response.text[:200]}"
1626+
)
16221627

16231628

16241629
@then("the response contains an Authorization header")

0 commit comments

Comments
 (0)