Skip to content

Test the request timeout, undeliverable base URLs and a non-ASCII application - #30

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/test-delivery-edge-cases
Nov 6, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/test-delivery-edge-cases

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage B unit-test expansion. Only tests/TraceClient.Tests/TraceClientTest.cs changes; no production code is touched. Six tests are added and one is tightened, all around delivery paths that were not reached before.

No tracking issue: the gaps were found during triage.

Finding

Json writes a repeated tag key twice, e.g. {"k":"first","k":"second"}. The test pins this as current behaviour. It is filed as #31, because any change would alter the wire format.

Test plan

  • Build workflow green on ubuntu-latest (net8.0): 109 tests against 102 on main, run 42154024472
  • Build workflow green on windows-latest (net8.0 + net48): 109 tests on each against 102 on main, same run

The local anchor is UNVERIFIED: no .NET SDK is installed in the dispatch sandbox, so the CI matrix on the head SHA is the gate. These are characterization tests, so this PR makes no fix claim and needs no FAIL→PASS evidence. Their sensitivity to mutation has not been measured.

The Unity (Mono/IL2CPP) runtime is not covered by CI. The #if branches cover .NET 8 and .NET Framework 4.8 only, and Unity behaviour with a non-ASCII User-Agent remains untested.

Deferred

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

…lication

Characterization tests for delivery paths the suite did not reach. The
5 s request timeout was only exercised through Close cancelling, so
dropping it from the HttpClient would have passed. No production code
changes.

Also pins a lone surrogate, a repeated tag key, the state left by Close,
and that a blank name logs nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (plain comment; not an independent review):

  • Scope: PASS. gh pr diff 30 --name-only lists only tests/TraceClient.Tests/TraceClientTest.cs, and every hunk adds a test or tightens Report_IgnoresABlankName.
  • Tests-new: PASS. No public member was added.
  • Tests-fix: not applicable. This is not a bug fix, and no production behaviour changed.
  • Sibling structure: PASS. No file was added; the tests follow the Subject_BehaviourInPlainWords naming and use StubServer and a ConcurrentQueue log.
  • Sibling renames: PASS. Nothing was renamed.
  • Docs: PASS. No documented behaviour changed, and the tests agree with the README paragraphs they pin.
  • Issue resolution: not applicable. There is no Closes reference.
  • CI: PASS. Run 42154024472 is green on head a5ee821: 109 tests on ubuntu net8.0, windows net8.0 and windows net48, against 102 on main. All seven new cases are in that count, with 0 skipped.
  • No dependencies: PASS. Neither csproj is touched.
  • Single file: PASS. Nothing under src/ changed.
  • Vendoring floor: PASS. The csproj is untouched and the net48 leg is green.
  • Never throws: PASS. No production code changed. The new base URL and timeout tests exercise this promise.
  • Non-blocking and bounded: PASS. No production code changed.
  • Environment seam: PASS. No production code changed.
  • Version agreement: not applicable. No version changed.
  • Opt-out contract: not applicable. Nothing in it changed.

Findings noted, not changed:

  • TraceClientTest.cs, Report_GivesUpOnAHangingRequestAtTheTimeoutAndSendsTheNextReport: this is a new timing-bound test, with a 4 s floor and a 12 s ceiling around a 5 s timeout. It passed on every leg, but a very slow runner could push it past the ceiling. A flake here should be read that way first.
  • The timeout test was not checked by removing the timeout and watching it fail. The claim that it would fail comes from reading the code, because no SDK is available locally. The PR body says that mutation sensitivity has not been measured.
  • README.md:145 and the DisabledReason XML doc: "null when the client reports" and "why Report sends nothing" do not cover a closed client, which sends nothing while the reason stays null. The new Close test pins this. A docs cycle could add a clause; it was left out to keep this PR test-only.
  • TraceClient.cs:157 constructor: localhost:8080 parses as a URI with the scheme localhost, so this likely mistake is reported on every send rather than by the constructor. Rejecting a non-HTTP scheme would change what the constructor throws, which is a contract decision, so it is only noted here.
  • The non-ASCII application test asserts on the word ASCII in a runtime message. A future .NET could reword it, which would fail the test without a behaviour change.

Do-not-auto-merge check: tests/TraceClient.Tests/TraceClientTest.cs is not listed, TraceClient.Tests.csproj is untouched, and no file has more than 50 lines deleted.

Local anchor: UNVERIFIED (no .NET SDK in the dispatch sandbox), so CI on the exact head SHA was used as the gate.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit fba43be into main Nov 6, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/test-delivery-edge-cases branch November 6, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant