Repository navigation
test: keep leftover log handlers out of the harness-parity context pin - #37478
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a test-only change that removes order-dependence in the test, leaves the behaviour it pins unchanged, and is reverted cleanly if wrong. Notes
[DESIGN-REVIEWED] 106d934 Description read[DESCRIPTION-READ] 92445efe46740262df22874fd6084e035e8847e6f6c09fbf01ccaa2bff03ef75 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates a 4% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. This is a test-only fix for an order-dependent failure. A dashboard server test leaves An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: isolates one harness-parity test from log handlers an earlier test left installed, test file only.
Problem / Motivation
Goal:
test_harness_parity.py::test_config_load_never_reads_the_platform_contextpasses whatever test ran before it in the same worker.The test failed on macOS shard 3 in run 43664027179 with
config normalization reached the platform context: ['installed_context', 'installed_context']. It is order-dependent: it fails only when a test that starts the dashboard server ran earlier in the same xdist worker, so a change in shard layout (as in #37422) turns it red.Why it matters
A red macOS shard blocks the Nightly publish and PRs that run macOS tests, with no product defect behind it.
Not a goal
_normalize_acp_backend, the log ring handler, or its redaction.What changed (motivation → approach → change)
Symptom: two
installed_contextreads, one for each unselectable value ('byo-harness',7), i.e. one perlogger.warning. Root cause: #29423 (abf107a) made the dashboard's_RingLogHandler.emitrun_stream_safe, which callssecurity.redact, which readsinstalled_context().dashboard/server.pyinstalls that handler on thekiro_crewlogger once per process and it is never removed, so any later warning in that worker reaches the platform context through the log sink. The normalization itself does not read the context: the spy saw nocurrent_contextcall, andinstalled_contextnever loads config, so there is no recursion risk. Change: the test detaches thekiro_crewlogger's handlers for its own duration (monkeypatch restores the list), so it pins the normalization and not leftover sinks.Backwards compatibility
Compatible: test-only change.
Removes nothing: the test still spies both context entry points; only leftover log handlers are detached for the test's duration.
Tests
test/test_harness_parity.py::test_config_load_never_reads_the_platform_contextno longer depends on test order.Proof: not provable -- test-only change
Manual verification
N/A — test-only; the PR's macOS CI run (ci:macos) is the check.
Related Issues
Order-dependent since #29423.
Sibling sweep
Swept: git grep -n "installed_context", lambda" -- test/
Siblings: none -- the other installed_context stubs return a fake context; this is the only one that counts calls and asserts there are none
Pattern harvest
Not generalizable: one spy-based test seeing a process-wide log handler another test installed; the conftest floor already documents why handlers are not restored.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.