Skip to content

test: clear TEND_ISSUE_NUMBER before each test so triage sessions see a green suite - #1703

Merged
max-sixty merged 1 commit into
mainfrom
daily/review-runs-44041556200-issue-env
Nov 17, 2026
Merged

max-sixty merged 1 commit into
mainfrom
daily/review-runs-44041556200-issue-env

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Inside a tend-triage session, 37 tests in shared/steps fail on a clean checkout. The triage matrix job sets TEND_ISSUE_NUMBER, the sandbox inherits it, and subject_number() reads it before the event payload. So every test that builds an event and checks which thread a step acts on gets the session's issue number instead, e.g. assert 1696 is None and assert 1696 == 851. This PR adds an autouse fixture to the root conftest.py that removes the variable before each test. The tests that exercise the matrix path set it themselves with monkeypatch.setenv, so they keep their coverage.

CI never sets the variable, so it stays green either way. The cost is in triage sessions, which run these suites while repairing an issue. AGENTS.md tells them that a failure beyond the two network-bound test_refresh_consumers.py tests is real, so every triage run that touches the runtime either chases 37 false failures or has to work out for itself that they're spurious. Triage run 43829170062 (#1696 → #1697) did the second: it reran without its change, saw the same 37, and moved on.

Verification: with TEND_ISSUE_NUMBER=1696 set, pytest shared/steps proxy gives 37 failed / 289 passed before the change and 326 passed after. The full suite with the variable set fails only the two network tests (those need DNS, which the sandbox doesn't have). The pre-commit hooks pass on conftest.py.

Failing tests before the change, with the variable set
File Failures
shared/steps/test_common.py 7
shared/steps/test_issue.py 12
shared/steps/test_mark_notification_read.py 15
shared/steps/test_token_usage.py 3

A triage matrix job sets it, the sandbox inherits it, and subject_number()
reads it before the event payload, so 37 shared/steps tests failed inside
triage sessions while passing in CI.
@tend-agent tend-agent added the review-runs Findings from review-runs skill label Nov 17, 2026
@max-sixty
max-sixty merged commit fc5f6ed into main Nov 17, 2026
12 checks passed
@max-sixty
max-sixty deleted the daily/review-runs-44041556200-issue-env branch November 17, 2026 08:13
max-sixty added a commit that referenced this pull request Nov 18, 2026
Bumps generator version to 0.3.27 and syncs lockfile.

8 commits since 0.3.26: nightly restarts stalled CI causes and weekly restarts other unfinished issues (#1688), review-runs drains outage trackers the bot closed (#1700), nightly files unfixed reachable defects as issues (#1699), the sandbox gets its own XDG_RUNTIME_DIR (#1697), comment and test fixes (#1701, #1702, #1703), and the 0.3.26 regeneration (#1695).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-runs Findings from review-runs skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants