Flaky test fixture: fake-process _feed thread can write after pipe close #166
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router#166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Provenance: remediation evidence from PR #164 (#143). Test-infrastructure only — no production impact is implied.
Affected area
tests/test_openai_codex_acquisition.py_FakeAppServer(tests/test_openai_codex_acquisition.py:94): fake Codex app-server process on a real pipe, with a daemon feeder thread_feed(tests/test_openai_codex_acquisition.py:149) writing scripted lines through a non-blocking write fd._close_write()(tests/test_openai_codex_acquisition.py:166) is the single shutdown seam: it sets the stop event, joins the feeder with a timeout (join(timeout=5.0), line 174), then closes the write fd exactly once under a lock.Race
The fixture's documented invariant — "the write end is closed only after the feeder thread has joined" — is only enforced up to the join timeout. Under deep-suite/load timing the feeder can be descheduled after passing its
_stopcheck but before (or between)os.write()attempts; if the bounded join lapses,_close_write()proceeds to close the write fd and the resumed feeder callsos.write()on the closed fd. The uncaughtOSError(EBADF) surfaces asException in thread ... (_feed)on stderr.Downstream effect: tests asserting empty captured stderr can then fail on that leaked traceback even when the behavior under test is correct.
Observed evidence
develop, while the #164 branch could pass under equivalent concurrent load.Acceptance for the future fix
Non-goal: do not conflate this with production Codex acquisition behavior unless investigation finds an actual production impact.
2026-10-27 owner backlog disposition (D-083, governance issue #228). This issue remains open with its
wontfixlabel unchanged; history preserved. Owner disposition: thejoin(timeout=5.0)/descriptor-close race is recorded as a test-infrastructure limitation — no demonstrated production dependency exists. No successor issue is registered; one is to be created only if a concrete CI failure or newly demonstrated product impact warrants it. See D-083 indocs/decisions.md.