Repository navigation
Description
What happens
tests/roadmap/test_roadmap_alternatives.py::test_the_decisions_are_cut_by_whole_entries_the_oldest_go_first_and_a_warning_says_so failed in one full local devops ci run on a loaded host. The test passes alone (166 passed in the file) and passes in the four GitHub shards.
Cause
The test compares the list of ALL warning records with the one expected warning. In the failing run, eight extra records came from the logger opentelemetry.sdk.trace.export with the text "Processor is already shutdown, ignoring call". A test that ran before it in the same xdist worker shut a span processor down and left the tracer state behind.
Expected
The test reads only the records of the logger devops_cli.roadmap.adr. The test that leaves the shut processor behind is found and its tracer state is reset.
Steps
- Run
uv run devops cion a loaded host, or run the telemetry tests and then the file in one worker. - Read the assertion at index 4 of the tuple.
Proposed design
Problem statement
The alternatives ADR cap test failed on a loaded host because it read warnings from other loggers. PR #4077 filters its records by logger name. A telemetry test still shuts down a span processor and leaves tracer state behind, so later tests can emit spurious warnings.
Acceptance criteria
Requirement: ADR cap test reads one logger
The alternatives ADR cap test SHALL assert only on log records whose logger name is devops_cli.roadmap.adr.
Scenario: An unrelated logger warns
- WHEN A logger other than
devops_cli.roadmap.adremits a warning during the ADR cap test. - THEN The test ignores that warning and asserts only the ADR cap warning.
Requirement: Telemetry test restores tracer state
The telemetry test that shuts down a span processor SHALL restore the OpenTelemetry tracer state after it runs.
Scenario: A later test exports a span
- WHEN The telemetry test that shuts down a span processor finishes and a later test exports a span.
- THEN No
Processor is already shutdown, ignoring callwarning is logged byopentelemetry.sdk.trace.export.
Requirement: Combined worker run passes
The telemetry tests and the alternatives ADR cap test SHALL pass when they run in one pytest worker.
Scenario: Telemetry tests run first
- WHEN The telemetry tests and the alternatives ADR cap test run in one pytest worker with the telemetry tests first.
- THEN pytest exits with status 0 and the ADR cap test reports no
Processor is already shutdown, ignoring callwarning.
Existing Tool Considered
No alternatives check has run. pytest's caplog fixture covers logger-scoped log capture. The OpenTelemetry TracerProvider lifecycle covers tracer-state restore. No new tool or library is necessary.
Key questions
- Should the ADR cap test filter captured records by logger name?: Yes. The test reads only records whose logger name is
devops_cli.roadmap.adr. Keep that filter and add a regression case for an unrelated warning. (best practice) [sources: tests/roadmap/test_roadmap_alternatives.py]- Chosen: Filter by logger name. It isolates the test from warnings of other loggers, including OpenTelemetry.
- Rejected: Assert every captured warning. It fails when an unrelated logger warns, as the loaded-host run showed.
- How should the test that shuts down a span processor restore tracer state?: Use a pytest fixture that saves the global tracer provider before the test and restores it after the test. Do not leave a shut provider in place. (best practice) [sources: tests/support/fakes/otlp.py, tests/roadmap/test_roadmap_alternatives.py]
- Chosen: Save and restore the provider in a fixture. It restores global state after the test and keeps later tests isolated.
- Rejected: Reset the provider in each telemetry test. It repeats setup and a new test can miss it.
- Rejected: Filter later tests only. It hides the leak and keeps cross-test coupling.
- Should the fix change production code or only tests?: Change only tests. The failure comes from cross-test state leakage, not from production logging or tracing. (best practice) [sources: tests/roadmap/test_roadmap_alternatives.py]
- Chosen: Test-only change. It fixes isolation without changing runtime behavior.
- Rejected: Change production logging or tracing. It adds risk and does not fix the leaked test state.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-10: partly.
Tool: pytest-dev/pytest (https://github.com/pytest-dev/pytest), MIT, last activity 2026-11-09, maintained.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A flaky test under load causes CI noise but does not block a user-facing feature.It removes a recurring CI failure that blocks merge confidence.The fix is to add a logger-name filter in one test and reset tracer state in another.Both fix test pollution from telemetry state in xdist workers, but the candidate filters log records by logger name while #3532 stops a logfire span from writing to stdout.dan-petty commentedon Nov 7, 2026
The test fails on PR #4077 (shard 2 of 4, run 42416842507): the log records hold 'Processor is already shutdown, ignoring call' lines next to the expected warning. #4077 does not touch this test or alternatives code. I re-ran the failed job.
test(roadmap): alternatives log tests read records of their own logger
dan-petty commentedon Nov 7, 2026
PR #4077 filters the log records of three alternatives tests by logger name (the first half of Expected). The second half stays open: find the test that leaves the shut span processor and reset its tracer state. The shard of #4077 failed twice on this test, so the order of tests in the worker made it fail every time there.
fix(roadmap): retitle records a skip mark for an item it leaves (#4077)
devops-cli-service commentedon Nov 8, 2026
Status set to Ready at b9c88de (see proposed design in issue body).
fix(roadmap): keep the trace facts of a plan in its record (#4285)
devops-cli-service commentedon Nov 10, 2026
Alternatives check: partly
Reason: pytest's
caplogfixture, which the test already uses, captures records per logger, so filtering by logger name needs no new tool. The pytest repository read confirms it is maintained. My one web search found no ready-made tool that resets OpenTelemetry's global tracer state between tests, so the fixture that saves and restores the provider has to be written in the repository.Tool: pytest-dev/pytest (https://github.com/pytest-dev/pytest)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
chore(main): release 0.138.0 (#5690)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC