Repository navigation
Cover the sender thread and an interrupted close() - #29
Merged
Merged
Conversation
The class Javadoc promises a single daemon thread, and close() cuts the drain short and restores the interrupt when the caller is interrupted. Neither was asserted. One test holds a request on a slow server and checks that exactly one thread named trace-client/<application> exists and that it is a daemon. The other interrupts the caller before close() and checks that close() returns well inside the drain timeout with the interrupt flag still set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (scored against the diff and command output; this is not an independent review):
Findings:
Summary: the PR adds characterization tests only, and the mutation check confirms both carry signal. With CI green and no do-not-auto-merge path touched, it meets the merge bar. 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.
Stage B: unit-test expansion (sender thread lifecycle). Only
TraceClientTest.javais changed; production code is not touched.Summary
report_sendsFromOneDaemonThreadNamedForTheApplication: a slow server holds the first request while five reports are queued. The test then checks that exactly one live thread namedtrace-client/ThreadProbeexists and that it is a daemon. This pins the class Javadoc's "single daemon thread owned by this client" promise. It also pins the property that a client never keeps the host JVM from exiting.close_whenInterruptedReturnsAtOnceAndKeepsTheInterruptFlag: with a request held in flight, the caller is interrupted beforeclose(). The test checks thatclose()returns in under 2 s (the drain bound is 5 s) and that the interrupt flag is still set afterwards. This covers thecatch (InterruptedException)branch ofclose(), which no test reached before.Both are characterization tests of current behaviour, and no bug was found.
Test plan
mvn -B verifyrun locally:Tests run: 86, Failures: 0, Errors: 0, Skipped: 0, and both new tests appear in the surefire reportbuild (8),build (17),build (21)green on the PR headDeferred issues
All three open issues require a maintainer decision and were not picked for this cycle:
versiontag atMAX_TAGS).No tracking issue. This gap was found during triage by comparing the branches of
TraceClient.javaagainstTraceClientTest.java.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