| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
|
Sir, thank you very much for being patient. Please run the tests when you have time. I welcome suggestions/criticism. I have also sent a message to the teaching email thread. |
Sorry, something went wrong.
…FILENO is a tty Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
…nBSD Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
|
🤖 New build scheduled with the buildbot fleet by @gpshead for commit 2a3cba4d8e906af233fc22b1be648bae05e7f08b 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
There was a problem hiding this comment.
i kicked off a test on the buildbots for some additional platform coverage out out curiosity. Note: our buildbot fleet may generate a lot of noise, they aren't all reliably and some were already failing on the main branch to begin with right now. so don't fret if it claims there are failures. only look for obviously related things within them if you go looking at those. :)
Sorry, something went wrong.
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
|
@gpshead I have removed those comments :) |
Sorry, something went wrong.
There was a problem hiding this comment.
I've completed a preliminary review of the test changes. Most of the suggested changes are fairly minor, for the most part I think this is good to go (although for the final approval/merge, I'd prefer to leave it to @ethanfurman or @Yhg1s since I'm no expert with pty or tty).
Sorry, something went wrong.
There was a problem hiding this comment.
Shouldn't this at least result in a warning via warnings.warn()? I suspect it would get buried otherwise.
Sorry, something went wrong.
There was a problem hiding this comment.
You are absolutely correct. I will change this. I have one question before I change this. If I use warnings.warn() here, then it will always generate warnings when the test is not run with stdin being a tty; for example the automated tests done by GitHub. Is that going to be an issue?
Sorry, something went wrong.
There was a problem hiding this comment.
It may cause a slight bit of extra noise on the tests, but it shouldn't cause the GitHub CI to fail when the warning is emitted (I don't believe we have any of our CI set to fail on warning, but it can be ran with that setting locally).
Sorry, something went wrong.
There was a problem hiding this comment.
This existing whitespace line should be re-added, since generally there are two lines in between the last line of a class's body and functions after it.
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for teaching me this. I will make this change.
Sorry, something went wrong.
There was a problem hiding this comment.
The news entry should optimally refer to the tests that were changed (in this case test_opentty was updated and a new test_master_read() was added.
Sorry, something went wrong.
There was a problem hiding this comment.
Sure!
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think this comment adds any additional context for the reader, and can be removed.
Sorry, something went wrong.
There was a problem hiding this comment.
Gotcha. I did this because the test_fork() function also has a similar comment at the end thereof. Should I remove that one as well?
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe @ethanfurman or @Yhg1s could clarify, but I don't think we should add a new "RELEVANT ANYMORE?" comment.
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for noticing this. I agree that they are annoying; I apologize for this. Yes, I need clarification. The plan was to remove the annoying "RELEVANT ANYMORE?" comments after clarification.
Sorry, something went wrong.
There was a problem hiding this comment.
I myself actually did not put much thought into the blocks that I marked with "RELEVANT ANYMORE?"; I will think about them in greater detail on Saturday. They were just supposed to be there as reminders; anyway, they do not hurt the tests :)
Sorry, something went wrong.
There was a problem hiding this comment.
Aah. Now I realize why I added the extra "RELEVANT ANYMORE" here. Notice that the following comment mentions pty.master_open(), which opens the slave and subsequently closes it. As a result, the original test_basic() function was having to call pty.slave_open() to re-open the slave. However, the new test_openpty() calls pty.openpty(), which, unlike pty.master_open(), does not close the slave end. Anyway, that part does not seem to affect the test on Linux and FreeBSD.
Sorry, something went wrong.
There was a problem hiding this comment.
Could we potentially surround with a try...finally to avoid this? A single test failure should really not result in the other tests within test_pty being unreliable.
Sorry, something went wrong.
There was a problem hiding this comment.
Good point. Thank you. I will work on this.
Sorry, something went wrong.
|
@aeros I am grateful for the reviews. I will keep working on this with the hope that we can finally put these old bugs to rest. |
Sorry, something went wrong.
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
|
@aeros Thank you for being patient. I have made the following changes as per your suggestions:
|
Sorry, something went wrong.
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
There was a problem hiding this comment.
I've been away from the code, so this might be a dumb question, but can't we determine if stdin is a tty?
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry for the late reply. That is actually a great question. tcgetattr() can fail due to 2 reasons: errno == EBADF ( not a valid file descriptor ), errno == ENOTTY ( not a tty ). See https://pubs.opengroup.org/onlinepubs/9699919799/. In either case, your stdin is not a tty. In fact, all glibc's isatty() does is call tcgetattr() to see if it fails; see https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/isatty.c.
I have verified that Linux, FreeBSD, and NetBSD follow this approach for their isatty() implementations, while OpenBSD calls fcntl()+F_ISATTY. Anyway, the tcgetattr() approach works on all the above platforms. I avoid isatty(), which is often followed by a separate tcgetattr() call, thereby avoiding an extra tcgetattr() call [ OCD :D ].
In our code, if tcgetattr() fails, then either pty.STDIN_FILENO, which is 0, is a valid fd but not a tty (ENOTTY), or it is not a valid fd at all (EBADF). EBADF will not happen unless something closes 0 [ uncommon scenario ]; for example, by using [ p close(0) ] in gdb, or if your script itself voluntarily closes 0 for some reason.
The "possible" in the comment # possible reason: current stdin is not a tty is not because of lack of confidence, but because I did not want to discount the (uncommon) chance of an EBADF, in which case 0 is not a valid fd at all [ OCD ]. Anyway, that comment can be safely removed. Do you want me to remove it?
Sorry, something went wrong.
There was a problem hiding this comment.
I would say update it:
# possible reason ... to # not a tty or bad/closed fd
and, of course, make that change throughout.
Sorry, something went wrong.
There was a problem hiding this comment.
Done.
Sorry, something went wrong.
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86 Gentoo Installed with X 3.x has failed when building commit c13d899. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/464/builds/445 Failed tests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 411 tests OK. 1 test failed: 13 tests skipped: 1 re-run test: Total duration: 28 min 6 sec Click to see traceback logsremote: Enumerating objects: 18, done.
remote: Counting objects: 5% (1/18)
remote: Counting objects: 11% (2/18)
remote: Counting objects: 16% (3/18)
remote: Counting objects: 22% (4/18)
remote: Counting objects: 27% (5/18)
remote: Counting objects: 33% (6/18)
remote: Counting objects: 38% (7/18)
remote: Counting objects: 44% (8/18)
remote: Counting objects: 50% (9/18)
remote: Counting objects: 55% (10/18)
remote: Counting objects: 61% (11/18)
remote: Counting objects: 66% (12/18)
remote: Counting objects: 72% (13/18)
remote: Counting objects: 77% (14/18)
remote: Counting objects: 83% (15/18)
remote: Counting objects: 88% (16/18)
remote: Counting objects: 94% (17/18)
remote: Counting objects: 100% (18/18)
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 10% (1/10)
remote: Compressing objects: 20% (2/10)
remote: Compressing objects: 30% (3/10)
remote: Compressing objects: 40% (4/10)
remote: Compressing objects: 50% (5/10)
remote: Compressing objects: 60% (6/10)
remote: Compressing objects: 70% (7/10)
remote: Compressing objects: 80% (8/10)
remote: Compressing objects: 90% (9/10)
remote: Compressing objects: 100% (10/10)
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 8), reused 1 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch master -> FETCH_HEAD
Reset branch 'master'
not a dynamic executable
not a dynamic executable
not a dynamic executable
WARNING: The script easy_install-3.10 is installed in '/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pip3 and pip3.10 are installed in '/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot x86 Gentoo Non-Debug with X 3.x has failed when building commit c13d899. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/58/builds/442 Failed tests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 414 tests OK. 10 slowest tests:
1 test failed: 10 tests skipped: 1 re-run test: Total duration: 35 min 23 sec Click to see traceback logsremote: Enumerating objects: 18, done.
remote: Counting objects: 5% (1/18)
remote: Counting objects: 11% (2/18)
remote: Counting objects: 16% (3/18)
remote: Counting objects: 22% (4/18)
remote: Counting objects: 27% (5/18)
remote: Counting objects: 33% (6/18)
remote: Counting objects: 38% (7/18)
remote: Counting objects: 44% (8/18)
remote: Counting objects: 50% (9/18)
remote: Counting objects: 55% (10/18)
remote: Counting objects: 61% (11/18)
remote: Counting objects: 66% (12/18)
remote: Counting objects: 72% (13/18)
remote: Counting objects: 77% (14/18)
remote: Counting objects: 83% (15/18)
remote: Counting objects: 88% (16/18)
remote: Counting objects: 94% (17/18)
remote: Counting objects: 100% (18/18)
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 10% (1/10)
remote: Compressing objects: 20% (2/10)
remote: Compressing objects: 30% (3/10)
remote: Compressing objects: 40% (4/10)
remote: Compressing objects: 50% (5/10)
remote: Compressing objects: 60% (6/10)
remote: Compressing objects: 70% (7/10)
remote: Compressing objects: 80% (8/10)
remote: Compressing objects: 90% (9/10)
remote: Compressing objects: 100% (10/10)
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 8), reused 1 (delta 0), pack-reused 0
From https://github.com/python/cpython
* branch master -> FETCH_HEAD
Reset branch 'master'
not a dynamic executable
not a dynamic executable |
Sorry, something went wrong.
|
The test fails with 'unexpected success' error, perhaps expectedFailure() should not be applied for this configuration. |
Sorry, something went wrong.
|
Or perhaps Gentoo is one of the cases where it succeeds, and the the expected failure wrapper should not be applied in that case. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This converts the test for pty.master_open() to a test for pty.openpty() with additional tests such as checking slave termios, slave winsize; these additional tests are expected to fail.
This also adds a small test that is expected to fail on FreeBSD and should pass on Linux; reflecting pty.spawn()'s FreeBSD hang issue [ bpo-26228 ].
Solutions to these problems have been implemented here: https://github.com/8vasu/pypty2
If and when these tests are acknowledged, the solutions will be submitted in parts.
This follows the conversation here: #21861
Signed-off-by: Soumendra Ganguly soumendraganguly@gmail.com
https://bugs.python.org/issue41818