Repository navigation
Fix two flaky tests: slow-teardown timing and pdb EOF race - #15151
Merged
RonnyPfannschmidt merged 2 commits intoOct 8, 2026
Merged
Conversation
test_console_output_style_times_slow_teardown_does_not_leak asserted that test_a2 takes under 0.1s. Windows CI measured 0.19s and 0.25s, which is test_a2's own runtime, not a leaked 0.3s teardown. Assert < 0.3s, which still catches the leak. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RPVUqQy85BXtPFPctRc71n
Member
Author
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.
|
The test sent EOF right after seeing the readouterr() output, while pdb could still be processing the command. The EOF was then sometimes lost and the child kept waiting for input until pexpect timed out (about 1 in 85 runs under xdist locally). Waiting for the next (Pdb) prompt, as the other tests in this module do, fixes it: 0 failures in 450 runs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RPVUqQy85BXtPFPctRc71n
nicoddemus
approved these changes
Oct 8, 2026
RonnyPfannschmidt
deleted the
claude/project-thread-o2uoxy-windows-timing
branch
October 8, 2026 12:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Ronny · project thread
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.
Before: two tests fail intermittently in CI.
TestTerminal::test_console_output_style_times_slow_teardown_does_not_leak(added in Bugfix 14412 subtests timing #14670) asserted thattest_a2shows a duration under 0.1s. Onbuild (windows-py311)for Derive ExceptionInfo strip text lazily from the exception #15149 it failed twice on the same commit, with0.2548and0.1947.TestPDB::test_pdb_and_capsyshit a pexpect timeout onbuild (ubuntu-py310-xdist)on this PR.After: both tests are stable.
How
< 0.3. The test guards againsttest_a1's 300 ms teardown leaking intotest_a2's reported time, and such a leak adds at least 0.3s. The measured 0.19–0.25s values aretest_a2's own runtime on a slow runner, so< 0.3still catches the leak without depending on runner speed.readouterr()output, while pdb could still be processing the command, and the EOF was sometimes lost. It now waits for the next(Pdb)prompt first, like the other tests intest_debugging.py. Locally, under xdist with 16 workers, the test failed 7 of 600 runs before and 0 of 450 after.Test-only changes, no changelog entry.
Co-authored-bycommit trailers.🤖 Generated with Claude Code
https://claude.ai/code/session_01RPVUqQy85BXtPFPctRc71n