-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-121973: Fix flaky test_pyrepl tests #122140
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
Conversation
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.
!buildbot s390x Fedora Refleaks |
🤖 New build scheduled with the buildbot fleet by @colesbury for commit d23344e 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
Good observation!
That looks like it's surfacing a different problem then, because
Without the extra newlines that may be so. But the new regex is a bit weird. There are no braces in the output, that's an f-string. It's 2am now, I'll come up with something in the morning. |
(maybe something as simple as a word boundary would work, i.e. |
I think There are braces in the output because the "output" also contains the input, which contains an f-string that we don't want to match. That's apparently how ptys work -- I don't make the rules! A nicer regex would be welcome. |
Ah, of course, you need to show user input in the terminal, of course. It works as regular output because of possible cursor changes, control characters, syntax highlighting, and stuff. In any case, I added a caret before the variable name in the output so we could match it. That way if we ever want to query a variable |
!buildbot s390x Fedora Refleaks |
Refleaks buildbot's happy with it, and so am I. |
Thanks @colesbury for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
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]>
GH-122173 is a backport of this pull request to the 3.13 branch. |
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. 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. Co-authored-by: Łukasz Langa <[email protected]>
This fixes the flakiness in:
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.