Repository navigation
test(minimald): drive an opted-out request through the channel, and verify runs it - #3286
Conversation
…erify runs it Two review points on #3165 that merged open. The in-box path had no test that drives `BoxChannel::run` with an `otel%off%` line and checks the channel's own trace record, so a change to the guard at the record could bring the command line back without a failure. The new test sends a plain public-exposure request and an opted-out one through the request sender under a thread-local TRACE subscriber: the plain request's `session channel handling` record carries its line, the opted-out request's line is in no record, and every record under it carries the opt-out mark the export layer honours. TEL-045's verify line now filters on the stem all three unit tests share, so running it checks the in-box path too, and its test list names the new one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Spec lintNo findings across 1 spec(s). Advisory, and never a merge gate. Linter: |
|
Reviewed: no findings; approval withheld, 1 thread unresolved at APPROVE withheld: 1 unresolved thread — norrietaylor docs/specs/25-spec-telemetry/25-spec-telemetry.md. Resolving the last thread releases the approval on this head. Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required. Clobber: none seen. |
norrietaylor
left a comment
There was a problem hiding this comment.
Scope matches the title. The diff adds one test, threads the request sender out of the channel test helpers, and widens one verify line in the telemetry spec. Clobber none. git log on both files shows the last change before this one is the fix this PR follows up (#3165). Nothing from that fix is reverted. Correctness The new test drives BoxChannel::run through the sender. It fails if the trace != TaskTrace::OptedOut guard at env.rs:1684 goes away, because the guarded trace! logs the whole line, otel%off% prefix included. The port=3232 lines come from the info! in refuse_public_expose, and that event runs inside the request span. The fmt layer shows the span's recorded telemetry field on that event. The helper refactor keeps every existing call site working, and the channel capacity of 4 holds both sends before run drains them. One finding: the widened verify filter now matches five minimald tests and no longer fails when a named test goes missing. Not checked that the test passes. That needs a build. The test also depends on a thread-local TRACE subscriber seeing a callsite that other tests can register first. test_harness::SpanLog documents this risk under libtest. Under nextest each test is its own process, so the risk does not apply there.
| that request: a non-recording span and no command line. | ||
| tier: T0 | ||
| verify: cargo nextest run -p minimald an_opted_out_request_leaves_no_daemon_span | ||
| verify: cargo nextest run -p minimald an_opted_out |
There was a problem hiding this comment.
low · The an_opted_out filter matches five minimald tests, not the three that the PR body names. It also runs connection.rs::an_opted_out_forward_or_attach_is_marked_and_unsampled and exec.rs::an_opted_out_git_span_is_marked_opt_out, which test other paths. The old full-name filter made nextest exit non-zero when it matched no test. With the stem, a rename or removal of a TEL-045 test still leaves the verify line green, because the other matches keep it passing. Every other verify line in this spec names one full test. Name the two minimald tests explicitly. nextest takes several filter arguments.
| verify: cargo nextest run -p minimald an_opted_out | |
| verify: cargo nextest run -p minimald an_opted_out_request_leaves_no_daemon_span an_opted_out_helper_request_ |
There was a problem hiding this comment.
Taken in a622690: the verify line names the three minimald tests the test: lines list (an_opted_out_request_leaves_no_daemon_span, the two env.rs helper tests), so a rename or removal of any of them fails the line; the client-side do_not_track_sends_the_opt_out_and_no_traceparent stays on the test: line, since the verify line is one crate. spec-lint is clean at this head.
The stem `an_opted_out` matched five minimald tests, two of them for other requirements, so a rename or removal of a TEL-045 test left the line green. The line names the three tests, as the other lines do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Follow-up to #3165, which merged with two of Norrie's review points open.
The in-box path had no test at the record. The guard that keeps an opted-out request's command line out of the daemon's
session channel handlingtrace record was covered only throughchannel_request_span, called directly, so a later change to the guard or to the record could bring the argv back without a failure. The new unit test drivesBoxChannel::runthrough the request sender with a plain public-exposure request and anotel%off%one, under a thread-local TRACE subscriber, and asserts three things: the plain request's record carries its line, the opted-out request's line is in no record, and every record under the opted-out request carries thetelemetry="opt-out"mark the export layer honours.TEL-045's verify line did not run the in-box test. Its nextest filter was the name of one test; it now filters on the stem all three unit tests share, and the
test:list names the new one.Test only, no behaviour change. The full CI mirror on Linux (workspace nextest, the native daemon e2e, clippy, doctests) passes, and the lab's opt-out scenario and baseline hold on Ubuntu 24.04 and Fedora against this tree.
🤖 Generated with Claude Code
Summary by CodeRabbit