Repository navigation
Test how a report reaches curl and how curl's end is told - #27
Merged
Merged
Conversation
The README's "How a report is sent" promises were mostly checked only as config text. These tests run them: a stand-in curl on PATH shows the fixed command line, the request on standard input, how each exit reaches the Logger, an early death with no SIGPIPE, a clean signal state in curl and the kill when close() gives up. StubServer learns to redirect, for the redirect that is not followed; other 2xx answers and a file: base URL are covered on every transport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline in a headless dispatch; not an independent review):
Findings:
Do-not-auto-merge paths: none touched (no workflow, Makefile, CMakeLists, curl argv, quoting, spawn code, This 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 test expansion for the README's "How a report is sent" section and the wire-format
201rule. Most of these promises were previously asserted only as text incurlConfigFixesEveryOptionAndQuotesEveryValue, or not at all. Onlytest/test_trace_client.cppis changed; these are characterization tests and production code is untouched.No tracking issue — gap found during triage.
On every transport:
onlyA201IsSuccess: 200, 202, 204, 400 and 500 each reach theLogger; a 201 does not.aRedirectIsAnAnswerAndIsNotFollowed: a 302 is logged and its target receives nothing.StubServergainedredirectTofor this;locationis guarded by the server's mutex so that TSan sees an ordering with the worker threads.aBaseUrlOfAnotherProtocolIsNeverTried: afile:base URL is refused by protocol, which is distinguished from the failure that a tried, missing file would give.On the POSIX default transport, a shell script placed first on
PATHstands in for curl (FakeCurl):theCommandLineIsFixedAndTheRequestGoesOnStandardInput: the arguments are exactly-q --silent --config -, and the URL, key and body arrive on standard input.theLoggerHearsHowCurlEnded: each exit path yields its message, including exit 127,000with exit 7, unparseable output, and a status that is believed whatever the exit code.aCurlThatDiesEarlyIsAnErrorNotASignal: a request far larger than a pipe is written to a curl that has already gone, and noSIGPIPEreaches the test program.curlStartsWithSigpipeUnblockedAndAtItsDefault: withSIGPIPEblocked on the sending thread and ignored by the host, the script's ownSIGPIPEstill ends it (curl did not finish).closeKillsTheCurlItGaveUpOn: the process of an abandoned request is gone afterclose()gives up, rather than left running.The five
FakeCurltests are registered only underTRACE_CLIENT_POSIX, so the printed test count differs by platform: 73 on the POSIX default transport, 68 on libcurl and on Windows. They are left out there rather than printed asokwithout running. Automated coverage gap: the Windowssend()paths andfindCurlremain without equivalent tests.Deferred issues
TRACE_CLIENT_CURLignored on Windows whenSystem32\curl.exeexists): awaits the owner's decision, and touches thecurl.exelookup on the do-not-auto-merge list.Test plan
make clean && make test(g++, C++11):73 tests, 0 failed checks, up from 65make clean && make test STD=c++2a(g++):73 tests, 0 failed checksmake test-libcurl:68 tests, 0 failed checksprotoline replaced bylocation = true:aBaseUrlOfAnotherProtocolIsNeverTriedandaRedirectIsAnAnswerAndIsNotFollowedfailedonlyA201IsSuccessfailed-qargument changed:theCommandLineIsFixedAndTheRequestGoesOnStandardInputfailedtheLoggerHearsHowCurlEndedfailedSIGKILLchanged to signal 0:closeKillsTheCurlItGaveUpOnfailedPOSIX_SPAWN_SETSIGMASKremoved, and separatelyPOSIX_SPAWN_SETSIGDEFremoved:curlStartsWithSigpipeUnblockedAndAtItsDefaultfailed each timeSIGPIPEleft unblocked on the sending thread: the test binary was killed (make: *** [Makefile:19: test] Broken pipe), which is the failureaCurlThatDiesEarlyIsAnErrorNotASignalguards. The run's per-test lines were not kept, so the test it died in was not observed directlyBuildgreen on heada3be266, including bothlinux-sanitizerslegs,macosandwindows: the nine POSIX default-transport jobs printed73 tests, 0 failed checks,linux-libcurlandwindowsprinted68 tests, 0 failed checks, and no sanitizer report appears in the logsclang++ is not installed locally and the TSan runtime was not run locally; both were covered by CI.
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