Repository navigation
Description
Problem
Tracer.__init__ sets the os.description resource attribute from platform.platform() (src/devops_cli/telemetry/tracer.py:742 on release/v0.2.29 at 05e9388). On Linux that reads platform.uname().processor, which runs uname -p through subprocess the first time a process asks. The tracer is built on first use, from trace_span (for example core/cli.py:97, _execute_traced_cli_command, and the span run_subprocess opens). So the first traced call in each process starts a uname child, dry runs included.
In tests, a fake that replaces subprocess.run receives that argv, and the result depends on test order:
tests/test_roadmap_intake.py::test_dry_run_makes_no_request_and_prints_the_requests_a_run_makes_in_orderfails when it runs first in its process:the dry run started a process: (['uname', '-p'],).tests/test_github_rate_limiter.py::test_each_identity_keeps_its_own_quota_and_response_cachefails when run alone on 05e9388 withKeyError: 'env': its fake records theunamecall, which carries noenv.- fix(github): a gh call at a quota window's reset waits out the reset second instead of failing as unknown or broken state #1364's new tests failed the same way until their fake passed commands other than gh through.
They pass in the full suite only because an earlier test in the same xdist worker filled platform's cache. The covering-test pre-commit hook runs a small selection, so it can fail on a change that doesn't touch these tests.
Proposed remedy
Build os.description from values that start no process, such as os.uname() (sysname, release, version) or platform.system()/platform.release()/platform.version(), which don't read the processor. No traced command then starts uname, whatever the test order.
Acceptance criteria
- A test builds the tracer with
subprocess.runandsubprocess.Popenreplaced by fakes that fail on any call, and asserts thatos.descriptionis set and no process started. - Both tests named above pass when run alone (
uv run pytest <nodeid> -n0 -p no:randomly). - Tests are offline, each call phase stays under 1 s, and
uv run devops cipasses.
Found while delivering #1358 and #1364. Related: #1358, #1364.
Update 2026-10-08: merged from #1411
#1411 is closed as a duplicate.
-
uv run pytest tests/test_github_rate_limiter.py -n0passes in file order and one shuffled order (pytest-randomly is not a dependency), each call phase under 1 s.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
It causes intermittent test and pre-commit hook failures but does not affect production behavior.It makes the test suite order-dependent and can trigger spurious CI or pre-commit failures, hurting developer productivity.The fix replaces one function call with an equivalent that does not spawn a subprocess, plus a small verification test.dan-petty commentedon Oct 20, 2026
This is already delivered.
src/devops_cli/telemetry/tracer.pyreadsplatform.system()andplatform.release().tests/test_telemetry.py. It landed in v0.2.33 (69c99cf).-n 0, checked on 2026-10-20 at the v0.2.37 tip.Closing as completed. The
platform.processor()pre-warm intests/test_ci_dry_run.pycan now go in any change that touches that file.fix(roadmap): intake calls a candidate a duplicate only when it asks …
fix(roadmap): intake judges a split part a duplicate of the issue tha…