Skip to content

test(civisibility): cover JSON retry recovery#4933

Open
darccio wants to merge 1 commit into
mainfrom
fix-pr4917-tony-feedback
Open

test(civisibility): cover JSON retry recovery#4933
darccio wants to merge 1 commit into
mainfrom
fix-pr4917-tony-feedback

Conversation

@darccio

@darccio darccio commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Adds the recovery-path unit test Tony suggested on merged PR #4917.

The existing test covered the retry-exhaustion path for repeated 2xx non-JSON responses and the default behavior when ExpectJSONResponse is false. This adds coverage for the main transient recovery scenario: the first 2xx response has a non-JSON Content-Type, then a retry returns a valid 2xx JSON response and succeeds.

Validation

  • go test ./internal/civisibility/utils/net -run 'TestSendRequestExpectJSONResponse(RetriesOnUnknownFormat|RecoversAfterUnknownFormat)$' -count=1
  • git diff --check

Note: full go test ./internal/civisibility/utils/net/... -count=1 failed locally in existing TestNewClient_DefaultValues with Expected serviceName to be set, got empty string, plus CI Visibility agentless API key logging. The targeted retry tests pass.

@datadog-official

datadog-official Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 62.87% (+4.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f20d981 | Docs | Datadog PR Page | Give us feedback!

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.

1 participant