Repository navigation
test: set Content-Type in empty-array round-trip trace RBAC tests - #942
Merged
pavolloffay merged 1 commit intoOct 22, 2026
Merged
pavolloffay merged 1 commit into
pavolloffay merged 1 commit into
Conversation
TestSearchResponseEmptyTracesPreserved and TestTraceByIDResponseEmptyResourceSpansPreserved (added in observatorium#934) build their http.Response with an empty header and relied on unmarshal() falling back to JSON for a missing Content-Type. observatorium#937 made unmarshal()/marshal() return "unsupported content type" for anything other than protobuf or JSON. observatorium#934's CI ran against a base from before observatorium#937, so the tests passed on the PR but fail on main since the merge (d17ce87). Set Content-Type: application/json in both tests, matching what the makeResponse helper in this file already does. The assertions still go through the JSON unmarshaler, so the empty-array round-trip they exist to protect is still covered. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pavolloffay
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
main'stestjob has been red since #934 was merged (d17ce87):This is a semantic conflict between two PRs that each passed CI on their own:
&http.Response{Header: http.Header{}}with noContent-Typeand relied onunmarshal()falling back to JSON.unmarshal()/marshal()returnunsupported content typefor anything other than protobuf or JSON.refs/pull/934/merge=d467c43into08aad9a, a base from before fix: trace query RBAC: do not try to unmarshal unsupported content types #937, and it was merged on Oct 13 without a re-run.Fix
Set
Content-Type: application/jsonin both tests, the same default themakeResponsehelper in this file already uses. Test-only change. The assertions still go through the JSON unmarshaler, so the empty-array round-trip they protect is still covered, and #937's stricter content-type handling is unchanged.Verification
go test -race -shorton all unit packages (e2e excluded, as inmake test-unit) passes.go vetandgofmtare clean.main(0b8e429) with the error above.The
test-e2efailure on thed17ce87push (TestMetricsReadAndWrite/OIDC_redirect_protection) is unrelated: #934 doesn't touch the metrics path, andtest-e2eis green on the nextmainpush (0b8e429).🤖 Generated with Claude Code