-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update asyncio library #6601
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
base: main
Are you sure you want to change the base?
Update asyncio library #6601
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (21)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fanninpm
left a comment
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.
Please rebase this branch on a fresh copy of main, then note the following little changes.
This PR also contains a "rider". At RustPython, we prefer to keep our PRs limited in scope, so you don't have to slog through 58 separate review comments.
|
@fanninpm thanks for all the comments! I'll go through them, and resolve them! (Also hope you had a great New Year + Happy Holiday season!) Could you also clarify what you mean by rider (I could not understand from the wikipedia link, and didn't find anything online). Do you mean the dual function of updating the library + adding the tests? (And if so, how would you suggest proceeding? Opening a new PR/closing this one?) |
e5c9bfc to
f53db35
Compare
|
@fanninpm, nevermind, I see what you mean 😓 I completely did not realize that unrelated commits had came with this PR. Thanks for catching it! |
|
@fanninpm everything should be good; I've made the formatting changes. As a clarification, I found some of the tests were automatically skipped in RustPython, but were running fine on CPython. The reason is commented below each instance of this occurring |
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.
Moral of the story: Don't skip any tests you don't have to skip. Most of the time, marking it as an expected failure will work and will let someone know that they totally accidentally made a test now pass.
Skipping a test should only be done if RustPython panics or hangs or if a test is flaky. Commenting out a test should only be done only in the extremest of circumstances: e.g., the test raises a syntax error in RustPython.
|
@fanninpm For all the CPython specific tests, If I don't add the explicit skip, it still skips, but for a different reason (for example if I remove the skip in I figured better to be thorough and add the explicit skip, so when "TODO: RustPython" is searched, it shows up. Let me know if you want me to remove it |
Does the
It might be better to just leave a comment, rather than a |
No it does not
Ok, I'll make the changes |
|
@fanninpm Made all changes! I was able to change all the skips into expectedFailures (/removed the ones in test_tasks), and I removed all the CPython skips. Please let me know if there is anything else I should fix (assuming the tests all pass)! |
fe90bee to
56be451
Compare
|
Re: the CPython specific tests, should I also add an issue for those? |
|
As an update, I've narrowed down the hang to an issue in the wait method of the Condition class. I think it's an issue with the AST generation? (but not 100%) The test that is failing is Whereas in CPython, the program is supposed to go from F) to G), RustPython instead goes from F) to B), re-entering the final statement again (reaquiring the lock again at C), reaching a deadlock state, and hanging. |
|
Thanks! That looks like a compiler bug. Is it possible to create a minimal reproducible script? 'the C _asyncio module' is a c module but probably not a CPython specific feature. We just need to implement it later. Though we usually prefer to update asyncio and test_asyncio at the same time, test_asyncio anyway even didn't exist in RustPython. Let's split this PR to 2 parts. Upgrade asyncio first, and see what's happening to other libraries. Currently it is not able to check because test_asyncio is hanging and other tests are not running. If no problem, asyncio will be merged. Then let's try to add test_asyncio again. It will take time due to the compiler problem |
56be451 to
ead7e0c
Compare
I'll work on getting something reproducible! In the meantime, Reopening this PR (Force pushing accidentally closed the issue) |
c7c7175 to
eba0a63
Compare
|
Great! Failing test is unexpected success |
Is it certain that this is not a fluke? |
|
usually not when 3 CI envs agree on |
|
@terryluan12 could you remove expectedFailure marker from the successful one? |
|
@youknowone @fanninpm It seems |
|
@terryluan12 If you can find out what test is the cause, mark it as |
|
Sounds good. I'm looking right now. I think I found it, but just need to confirm |
youknowone
left a comment
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.
Adding information "random" is important. Otherwise another patch will remove the line, and watching CI passes just like now without patch, and then the CI will hang again
|
Sounds good! In terms of |
|
Lol, okay, this is so hacked together. Thoughts @youknowone @fanninpm ? (I annotated the lines added, but they will not be on the final commit) |
|
We usually don't edit the inside of test without a good reason. Because editing inside increase the cost of updating the test to a new version. Is this test critical enough to enable by editing test code? Otherwise marking the entire test expectedFailure is more desired. |
I'm not sure what's meant by criticality, but the main issue is that these tests are run/created dynamically. So this test is used for the WithProcessesTestManagerRestart, WithThreadsTestManagerRestart, and WithManagerTestManagerRestart test classes. As a result, if it's marked expectedFailure, then it will be expectedFailure for all three test classes; but the issue is that it succeeds for two out of the three classes, so no matter what, tests will fail |
|
You can create an override of the method in the subclass |
|
Code has been automatically formatted The code in this PR has been formatted using git pull origin update_asyncio |
f2146f8 to
6281a3b
Compare
763b0ad to
ccb382f
Compare
|
Could you please rebase this branch on a fresh copy of |
|
This must be almost done. Could you rebase this one to the main? |
3615b3f to
f37485f
Compare
|
I believe the failure in the ubuntu CI, is the same issue as #6716. Other than that, this should be good to rereview! |
Notes:
test_server.py,test_proactor_events.py,test_buffered_proto.py,test_sslproto.py,test_subprocess.py(kinda), andtest_windows_events.pyandtest_windows_utils.pytest_ssl.TestSSL.test_create_server_ssl_1andtest_ssl.TestSSL.test_create_server_ssl_over_ssldue to lack of memorytest_subprocess.pyandtest_events.py