Skip to content

test(destination): skip flaky http client test on non-2xx echo response#218

Merged
jplbrun merged 1 commit into
mainfrom
test/destination-fix-flaky-http-client-integration
Jul 8, 2026
Merged

test(destination): skip flaky http client test on non-2xx echo response#218
jplbrun merged 1 commit into
mainfrom
test/destination-fix-flaky-http-client-integration

Conversation

@jplbrun

@jplbrun jplbrun commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: Do not include SAP-internal or customer-specific information in this PR (e.g. internal system URLs, customer names, tenant IDs, or confidential configurations). This is a public repository.

Description

Fixes a flaky destination integration test (test_destinationhttpclient_sends_an_authenticated_request_using_token_fetched_from_btp) that occasionally failed with JSONDecodeError because the test called response.json() on the reply from httpbin.org, but httpbin sometimes returned a non-JSON error body (CDN 502/503 HTML, rate-limit page)

The fix adds a response.ok check after the request: if the echo service returned a non-2xx status, pytest.skip with the status code and a body preview

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

  1. uv run pytest tests/destination/integration -v

Checklist

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes — N/A, this is
    itself a test-only change
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable) — N/A
  • I have added type hints for all public APIs — N/A (test code)
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

None

Additional Notes

None

@jplbrun jplbrun marked this pull request as ready for review July 8, 2026 19:44
@jplbrun jplbrun requested a review from a team as a code owner July 8, 2026 19:44
@jplbrun jplbrun merged commit fa22801 into main Jul 8, 2026
11 checks passed
@jplbrun jplbrun deleted the test/destination-fix-flaky-http-client-integration branch July 8, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants