Skip to content

gh-110088, gh-109878: Fix test_asyncio timeouts - #110092

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:asyncio_timeout
Sep 29, 2023
Merged

gh-110088, gh-109878: Fix test_asyncio timeouts#110092
vstinner merged 1 commit into
python:mainfrom
vstinner:asyncio_timeout

Conversation

@vstinner

@vstinnervstinner commented Sep 29, 2023

Copy link
Copy Markdown
Member

Fix test_asyncio timeouts: don't measure the maximum duration, a test should not measure a CI performance. Only measure the minimum duration when a task has a timeout or delay. Add CLOCK_RES to test_asyncio.utils.

Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
@vstinner

Copy link
Copy Markdown
MemberAuthor

Windows x64 failed with:

FAIL: test_taskgroup_04 (test.test_asyncio.test_taskgroups.TestTaskGroup.test_taskgroup_04)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\a\cpython\cpython\Lib\unittest\async_case.py", line 90, in _callTestMethod
if self._callMaybeAsync(method) is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\cpython\cpython\Lib\unittest\async_case.py", line 112, in _callMaybeAsync
return self._asyncioRunner.run(
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\cpython\cpython\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\cpython\cpython\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\a\cpython\cpython\Lib\test\test_asyncio\test_taskgroups.py", line 121, in test_taskgroup_04
self.assertEqual(NUM, 0)
AssertionError: 1 != 0

@vstinner
vstinner merged commit db0a258 into python:mainSep 29, 2023
@vstinner
vstinner deleted the asyncio_timeout branch September 29, 2023 11:49
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker db0a258e796703e12befea9d6dec04e349ca2f5b 3.12

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker db0a258e796703e12befea9d6dec04e349ca2f5b 3.11

vstinner added a commit to vstinner/cpython that referenced this pull request Sep 29, 2023
…10092)
Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
(cherry picked from commit db0a258)
@bedevere-app

Copy link
Copy Markdown

GH-110098 is a backport of this pull request to the 3.12 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only security fixes label Sep 29, 2023
@bedevere-app

Copy link
Copy Markdown

GH-110099 is a backport of this pull request to the 3.11 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.11 only security fixes label Sep 29, 2023
vstinner added a commit that referenced this pull request Sep 29, 2023
…0099)
gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)
Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
(cherry picked from commit db0a258)
vstinner added a commit to vstinner/cpython that referenced this pull request Oct 2, 2023
…10092)
Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
(cherry picked from commit db0a258)
vstinner added a commit that referenced this pull request Oct 2, 2023
…0098)
gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)
Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
(cherry picked from commit db0a258)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…10092)
Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testsTests in the Lib/test dirtopic-asyncio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vstinner@miss-islington