Repository navigation
Test the constructor's error messages and its daemon sender thread - #20
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Self-review rubric (scored against CI and the diff, assuming FAIL unless shown otherwise):
Judgment call: the thread tests take a snapshot of tests/test_trace_client.py:400: the check uses This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
Summary
Stage B (unit-test expansion) of the constructor. Only tests change, and they record what the code does today; no production code is touched.
test_constructor_errors_name_the_argument_they_reject: eachValueError(the client's only raising path) names the argument it rejects (base_url,application,version,install_id). The overlong-value errors also nameMAX_TAG_LENGTH. Before this, the tests only checked thatValueErrorwas raised.test_the_sender_is_one_daemon_thread_named_after_the_application: an enabled client starts exactly one thread. It is a daemon, so it never keeps the host program from exiting, and it is namedtrace-client/<trimmed application>.close()stops it. Nothing tested the "daemon thread" part of the README's "Returns immediately" promise before this.test_a_disabled_client_starts_no_thread:enabled=False, no key andTraceClient.disabled()start no thread. This backs the "does nothing and costs nothing" claim.The thread checks only count threads that appear while the test runs, so threads left over from earlier tests that exit during it cannot make it fail.
Test plan
python3 -m unittest -vlocally on Python 3.8.10:Ran 59 tests,OK(56 before)Buildjobstest (3.8),test (3.10),test (3.12)greenDeferred
MAX_TAGS) was not picked up. It needs an owner decision on whether the README promise thattags"always holds at leastversion" should hold at the tag cap. The change would also have to be made in step with trace-client-java, so it cannot land from this repo alone.trace-client-java
Nothing a Java user can observe has changed (tests only), so no matching change is needed.
No tracking issue: the gaps were found during triage.
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