Repository navigation
Cover send() with a non-http base URL and a reply that has a body - #19
Merged
Merged
Conversation
send() catches RuntimeException because a misconfigured URL surfaces as one, but no test drove that path: a file: base URL opens a connection that is not an HttpURLConnection, and "not a url" is a MalformedURLException. Both are now pinned as a FINE "could not deliver" line with the client still enabled. A second test answers 500 and then 201 with bodies larger than drain()'s buffer, and checks the second report still goes out and only the 500 is logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on CI run 39018406508 on the PR head):
Findings:
Summary: a test-only PR, green on the full matrix. No do-not-auto-merge path is touched. Merge is left to a human because this dispatch is not authorized to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
Stage B (unit-test expansion) for
send()'s failure paths. OnlyTraceClientTest.javais changed; production code is untouched.report_aBaseUrlThatIsNotHttpIsLoggedFineAndNeverThrows: the comment insend()says a misconfigured URL surfaces as aRuntimeException, which is why that type is caught alongsideIOException. No existing test drove that branch. Two base URLs are now pinned:"not a url"leads toMalformedURLException(theIOExceptionside);"file:///trace-client-test"opens a non-HttpURLConnection, so the cast fails withClassCastException(theRuntimeExceptionside).Each case is asserted to build an enabled client without throwing, to report without throwing, and to log one
FINEline starting[trace] could not deliver {...that names the exception.report_drainsAResponseBodyAndKeepsSendingAfterAnError: the shared fixture server always replies with no body, sodrain()had only ever seen an empty input stream; its read loop never ran over real content, and never over an error stream. A local server now answers 500 and then 201, each with a 4096-byte body (larger thandrain()'s 512-byte buffer). The test checks that:[trace] trace server answered 500 for <body>.Test plan
mvn -B verifyrun locally on Java 21:Tests run: 78, Failures: 0, Errors: 0, Skipped: 0, with both new tests listed in the surefire reportbuild (8),build (17),build (21)green on the PR head (Java 8 is the floor; only Java 21 was available locally)Deferred
withVersionexceedingMAX_TAGS) was not picked up. Every fix it lists changes what is sent on the wire, a behaviour-contract change reserved for a human decision.No tracking issue: this gap was found during triage by comparing
send()against the existing tests.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson