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

mtest: Inline try_wait_one using asyncio.wait_for #10633

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 27, 2022

Although the former accepts multiple awaitables, it is only ever called with a single one, so just use wait_for instead.

Additionally, the try_wait_one fails in Python 3.11, as Process.wait() returns a coroutine, and asyncio.wait only accepts tasks, so it errors out.

Although the former accepts multiple awaitables, it is only ever called
with a single one, so just use `wait_for` instead.

Additionally, the `try_wait_one` fails in Python 3.11, as
`Process.wait()` returns a coroutine, and `asyncio.wait` only accepts
tasks, so it errors out.
@QuLogic QuLogic changed the title Inline try_wait_one using asyncio.wait_for mtest: Inline try_wait_one using asyncio.wait_for Jul 27, 2022
@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #10633 (fdeef46) into master (1e1dee7) will decrease coverage by 0.00%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##           master   #10633      +/-   ##
==========================================
- Coverage   68.82%   68.82%   -0.01%     
==========================================
  Files         406      406              
  Lines       88062    88066       +4     
  Branches    19560    19566       +6     
==========================================
  Hits        60612    60612              
- Misses      22871    22875       +4     
  Partials     4579     4579              
Impacted Files Coverage Δ
mesonbuild/mtest.py 77.11% <14.28%> (-0.11%) ⬇️
mtest.py 77.04% <0.00%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e1dee7...fdeef46. Read the comment docs.

@eli-schwartz
Copy link
Member

@bonzini does this look right to you?

@bonzini
Copy link
Contributor

bonzini commented Aug 1, 2022

Yes, it does.

@bonzini
Copy link
Contributor

bonzini commented Aug 1, 2022

Additionally, the try_wait_one fails in Python 3.11, as Process.wait() returns a coroutine, and asyncio.wait only accepts tasks, so it errors out

@QuLogic is this a documented change? If not we should report a bug.

@QuLogic
Copy link
Member Author

QuLogic commented Aug 1, 2022

It was deprecated in 3.8, and scheduled for removal in 3.11: https://docs.python.org/3/library/asyncio-task.html#asyncio.wait

@bonzini
Copy link
Contributor

bonzini commented Aug 1, 2022

Ah I interpreted that as "Process.wait() returns a coroutine in 3.11 instead of another kind of future", thanks.

@eli-schwartz
Copy link
Member

eli-schwartz commented Aug 1, 2022

Hmm, I tried to run the Meson testsuite with a warning filter that turns deprecations into errors, and I got a bunch of failures. But I never made it as far as this, I don't think. Instead, meson test seems to immediately error out with:

[0/1] Running all tests.
Traceback (most recent call last):
  File "/home/eschwartz/git/meson/mesonbuild/mesonmain.py", line 153, in run
    return options.run_func(options)
  File "/home/eschwartz/git/meson/mesonbuild/mtest.py", line 2049, in run
    return th.doit()
  File "/home/eschwartz/git/meson/mesonbuild/mtest.py", line 1726, in doit
    self.run_tests(runners)
  File "/home/eschwartz/git/meson/mesonbuild/mtest.py", line 1864, in run_tests
    loop = asyncio.get_event_loop()
DeprecationWarning: There is no current event loop

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

@eli-schwartz eli-schwartz merged commit 2762612 into mesonbuild:master Aug 1, 2022
@QuLogic QuLogic deleted the wait_for-proc-wait branch August 2, 2022 19:38
@nirbheek nirbheek added this to the 0.63.1 milestone Aug 8, 2022
gnomesysadmins pushed a commit to GNOME/glib that referenced this pull request Oct 25, 2023
And update all the CI builds to use the latest micro release from that
series, 1.2.3.

This version bump means we can:
 - Drop some backwards-compatibility Meson checks
 - Fix a periodic CI failure caused by a now-fixed Meson bug
   (mesonbuild/meson#10633)

It’s in line with our [Meson version policy](./docs/meson-version.md),
as Meson 1.2.1 is available in
[Debian Trixie](https://packages.debian.org/source/trixie/meson) and the
[freedesktop SDK](https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/c95902f2ed5cb7d9b8e352135facc539029ef6c9/elements/components/meson.bst).

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants