GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform by asvetlov · Pull Request #23514 · python/cpython

Conversation

@asvetlov

@asvetlov asvetlov commented Nov 25, 2020 •
edited by miss-islington
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fix buildbot failures introduced after #22962 merging.

https://bugs.python.org/issue41818

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asvetlov
test_openpty succeded on Gentoo, don't expect to fail it on this plat…
4ba515d
…form
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Nov 25, 2020
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting core review labels Nov 25, 2020
@asvetlov asvetlov added 🔨 test-with-buildbots Test PR w/ buildbots; report in status section skip news labels Nov 25, 2020
@bedevere-bot

bedevere-bot commented Nov 25, 2020

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @asvetlov for commit 4ba515d 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 25, 2020
@asvetlov asvetlov mentioned this pull request Nov 25, 2020
bpo-41818: Updated tests for the standard pty library #22962
Merged
ethanfurman
ethanfurman approved these changes Nov 25, 2020
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Nov 25, 2020
@asvetlov asvetlov added the 🤖 automerge label Nov 25, 2020
vstinner
vstinner reviewed Nov 25, 2020
View reviewed changes
Comment thread Lib/test/test_pty.py
os_release = pathlib.Path("/etc/os-release")
if os_release.exists():
# Actually the file has complex multi-line structure,
# these is no need to parse it for Gentoo check

@vstinner vstinner Nov 25, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://bugs.python.org/issue28468

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tiran reacted with laugh emoji
All reactions
  • 😄 1 reaction

@asvetlov asvetlov Nov 25, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vstinner @tiran I happy to use freedesktop_os_release() when it lands but want to merge this PR ASAP to fix the broken buildbot.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Nov 25, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vstinner @tiran I happy to use freedesktop_os_release() when it lands but want to merge this PR ASAP to fix the broken buildbot.

Sure.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vstinner
vstinner reviewed Nov 25, 2020
View reviewed changes
Comment thread Lib/test/test_pty.py

def expectedFailureIfStdinIsTTY(fun):
# avoid isatty() for now
PLATFORM = platform.system()

@vstinner vstinner Nov 25, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the rationale for skipping the test only on Gentoo. Would you mind to write a comment to explaining the rationale? Why not skipping the test on Ubuntu? Is it a temporary workaround until someone can investigate the root issue? Please add a reference to bpo-41818 in the command.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@asvetlov asvetlov Nov 25, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is the reverse: Gentoo passes the test, all other tested Linux distributions fail.
That's why expectedFailure() is applied for each platform where stdin is a TTY except Gentoo.

I'll add a comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asvetlov
Add a comment for reason to don't apply expectedFailure() on Gentoo
2d45ca1
@miss-islington

miss-islington commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

@asvetlov: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@miss-islington

miss-islington commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

@asvetlov: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

Sorry, I can't merge this PR. Reason: 2 of 4 required status checks are expected..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@miss-islington

miss-islington commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

Sorry, I can't merge this PR. Reason: 2 of 4 required status checks are expected..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asvetlov asvetlov removed the 🤖 automerge label Nov 25, 2020
@8vasu

8vasu commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

I just noticed this. I have a 1-2 hour(s) long meeting with my advisor that is scheduled to start in an hour. After that, I will install Gentoo in a VM to inspect what exactly is happening. Thank you for being patient.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asvetlov
asvetlov merged commit 87f7ab5 into python:master Nov 25, 2020
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 25, 2020
@asvetlov
asvetlov deleted the fix-pty-test branch November 25, 2020 17:06
@asvetlov

asvetlov commented Nov 25, 2020

Copy link
Copy Markdown
Contributor Author

@8vasu take your time.
The bots are green now, the investigation can be as long as needed.
Without this quick-fix I should apply our policy and revert #22962 entirely.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@8vasu

8vasu commented Nov 25, 2020

Copy link
Copy Markdown
Contributor

@asvetlov Thank you for being so kind. Also, thank you for preparing this quick-fix. My advisor has postponed the meeting because of thanksgiving preparation. I will look into this matter now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@8vasu

8vasu commented Nov 25, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@ethanfurman @asvetlov I created a Gentoo VM which is currently running emerge; it looks like it might take a lot more time for that to finish. I will let it run. I created a second Gentoo VM, and performed the tests using the live cd.

There are a few things to note. I realized that by default, the live cd does not include a C compiler; their "stage tarballs" include a C compiler. Since I already have one VM currently performing a full installation of Gentoo, I decided to avoid performing those steps again. As an initial phase of the investigation, I ran the tests using the python3.7 that was already available on the live cd.

To be able to run the tests using Python 3.7, I had to comment out the 2 import_module lines. Both of them ran as I had expected them to run: test_openpty() resulted in an OK (expected failures=1); test_master_read() passed. I do not exactly know how the bot was able to make test_openpty() pass.

I will try compiling Python 3.10 after Gentoo is fully installed in the first VM.

Edit: I ran the tests without applying this quick-fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zware

zware commented Nov 25, 2020

Copy link
Copy Markdown
Member

FTR, I have serious doubts that this is a Gentoo-specific issue. Note that this bot is run using buildbot's usePTY option so that curses tests will run; see

https://github.com/python/buildmaster-config/blob/db57e24feb7c41c07a84b502838e7b849f251661/master/master.cfg#L143-L148

and

https://github.com/python/buildmaster-config/blob/db57e24feb7c41c07a84b502838e7b849f251661/master/custom/factories.py#L125-L132

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zware

zware commented Nov 25, 2020

Copy link
Copy Markdown
Member

In fact, running this test on both of my Gentoo machines (including the one running the buildbot worker in question) in an interactive SSH session, there is a failure with this change:

0:00:00 load avg: 9.92 [1/1] test_pty
test test_pty failed -- Traceback (most recent call last):
  File "/python/cpython/master/Lib/test/test_pty.py", line 201, in test_openpty
    self.assertEqual(_get_term_winsz(slave_fd), new_stdin_winsz,
AssertionError: b'\x00\x00\x00\x00\x00\x00\x00\x00' != b'\r\x006\x00\x00\x00\x00\x00' : openpty() failed to set slave window size

There is no such failure without this change, or when run in a non-interactive SSH session.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@8vasu

8vasu commented Nov 26, 2020

Copy link
Copy Markdown
Contributor

@zware I also have doubts about that. Thank you for the help. I can now reinforce your doubts. I just finished installing Gentoo; it took half a day for the process to complete.

Some details:

  1. as suggested in the devguide, I compiled Python 3.10 WITHOUT including this quick-fix using ./configure --with-pydebug && make -j
  2. I did not install X or Wayland; the commands were invoked on the terminal emulator provided by the kernel (/dev/tty1); $TERM was linux

Everything went as expected when I ran ./python -m test -j3: there was one expected failure, since stdin was a tty. Then, for further inspection,

  1. I ran ./python Lib/test/test_pty.py PtyTest.test_openpty to obtain OK (expected failures=1); stdin was a tty in this case
  2. I ran ./python Lib/test/test_pty.py PtyTest.test_openpty < /dev/null to obtain OK; stdin was not a tty in this case

Both the above results were as expected. Therefore, I am still not sure how the buildbot was able to make the test pass earlier.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@8vasu

8vasu commented Nov 27, 2020

Copy link
Copy Markdown
Contributor

Update: #23526

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@asvetlov @adorilson
bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on th…
1cbbdb5
…is platform (pythonGH-23514)
@8vasu 8vasu mannequin mentioned this pull request May 5, 2022
Lib/pty.py major revision #85984
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@ethanfurman ethanfurman ethanfurman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@asvetlov @bedevere-bot @miss-islington @8vasu @zware @vstinner @ethanfurman @the-knights-who-say-ni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.