Skip to content
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

Fix potential flakiness in test_run_until_complete_baseexception #100148

Merged
merged 1 commit into from
Dec 10, 2022

Conversation

fantix
Copy link
Contributor

@fantix fantix commented Dec 9, 2022

Refs #24477, use a more reliable way to run the test.

If the covering issue happens again, the loop would be requested to stop in the first iteration and got stopped after the first iteration. In that case, our func() in the second iteration won't be called.

  • skip issue
  • skip news

@bedevere-bot bedevere-bot added awaiting review tests Tests in the Lib/test dir labels Dec 9, 2022
@python python deleted a comment from netlify bot Dec 10, 2022
@gvanrossum
Copy link
Member

@kumaraditya303 Can you review this?

@kumaraditya303
Copy link
Contributor

Can you review this?

Done & merged.

@kumaraditya303
Copy link
Contributor

This is indeed better than sleeping for a small delay.

kumaraditya303 pushed a commit to kumaraditya303/cpython that referenced this pull request Dec 10, 2022
kumaraditya303 pushed a commit to kumaraditya303/cpython that referenced this pull request Dec 10, 2022
@fantix fantix deleted the asyncio-close-test-fix branch December 10, 2022 15:32
@gvanrossum
Copy link
Member

Yup, a very insightful solution. Thanks @fantix !

@AlexWaygood
Copy link
Member

This PR appears to have resulted in an empty commit, likely because the PR branch was not fully up to date with main: a9bad4d :/

@gvanrossum
Copy link
Member

This PR appears to have resulted in an empty commit, likely because the PR branch was not fully up to date with main: a9bad4d :/

Very weird. Especially since when I check out main and pull to head, the change is there, and attributed to this PR. So maybe the problem is with the GitHub UI? I saw some mention of enpty branches on Discord but chose to ignore it.

@AlexWaygood
Copy link
Member

Oh, weird. Yes, I see the same. It must be something wrong with the GitHub UI. My sincere apologies for the false accusation, @fantix!

@fantix
Copy link
Contributor Author

fantix commented Dec 10, 2022

No worries @AlexWaygood , thank you for being careful ❤️

@gvanrossum
Copy link
Member

Hm, there's definitely something weird though. I see three commits for this PR in the main branch:

commit a9bad4d28413666edc57551dd439bca6a6a59dd9
Author: Fantix King <fantix.king@gmail.com>
Date:   Sat Dec 10 02:05:24 2022

    Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)
    
    

commit f28e537125941d9f8894ec01b5e87252e824a688
Author: Fantix King <fantix.king@gmail.com>
Date:   Sat Dec 10 02:04:50 2022

    Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)
    
    

commit 50b08d5b5fd3e280b99b97a42d07089a64bf12c6
Author: Fantix King <fantix.king@gmail.com>
Date:   Sat Dec 10 02:04:22 2022

    Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)
    
    

diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 532a7e5385..3b4026cb73 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -868,7 +868,7 @@ def func():
             self.loop.stop()
             func.called = True
         func.called = False
-        self.loop.call_later(0.01, func)
+        self.loop.call_soon(self.loop.call_soon, func)
         self.loop.run_forever()
         self.assertTrue(func.called)

Two of those are empty. What kind of GitHub hiccup could have caused that???

@kumaraditya303
Copy link
Contributor

Possibly we can report this to GitHub somehow or ask anyone from GitHub to look at this? I don't know how to do it though.

rwgk pushed a commit to rwgk/cpython that referenced this pull request Mar 11, 2023
rwgk pushed a commit to rwgk/cpython that referenced this pull request Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants