Make BrokenPipeError test deterministic.#4127
Open
tjni wants to merge 3 commits into
Open
Conversation
This test seems to be flaky (albeit rarely). We can try to make it deterministic by writing more data during the test to reliably trigger BrokenPipeError.
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.
Type of changes
AI?
I used Codex with GPT-5.4 on Medium effort to investigate and generate local scripts to reproduce the flakiness as well as to create the initial version of the patch, but then I also manually read over and tweaked it to remove unnecessary lines such as certain comments and extra assertions.
Checklist
Description
test_brokenpipeerrorseems to be flaky (albeit rarely). We can try to make it deterministic by writing more data during the test to reliably trigger BrokenPipeError.I specifically ran into this while building
python3Packages.richfrom nixpkgs locally using Nix, and during research found that some other package managers have also disabled this test, e.g.:I had Codex generate locally some scripts to reproduce this, and it was able to do so against Python 3.13 after a few hundred iterations, and with these changes I was not able to reproduce it again locally, so I feel it could be worth a try.
I have at present skipped creating a discussion because I feel this falls under "clear bug-fixes / typos etc". I also refrained from updating the CHANGELOG, because it appeared to me that entries under there look like external facing changes. I'm happy to make any changes needed, however.