Skip to content

[3.13] gh-121973: Fix flaky test_pyrepl tests (GH-122140) #122173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 23, 2024

This fixes the flakiness in:

  • test_inspect_keeps_globals_from_inspected_file
  • test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7)

Co-authored-by: Sam Gross [email protected]
Co-authored-by: Łukasz Langa [email protected]

This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7)

Co-authored-by: Sam Gross <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
@bedevere-app bedevere-app bot added skip news topic-repl Related to the interactive shell labels Jul 23, 2024
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Jul 23, 2024
@ambv ambv merged commit 214b430 into python:3.13 Jul 23, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir topic-repl Related to the interactive shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants