Commit 64dff42
authored
[mypyc] Fix async mypyc tests on Windows (#19578)
This is part of fixing the failed tests in
#19545
The async tests previously used many invocations of `asyncio.run`, which
likely caused issues with event loop management. The documentation for
`asyncio.run` states:
> This function cannot be called when another asyncio event loop is
running in the same thread. ...
> This function should be used as a main entry point for asyncio
programs, and should ideally only be called once.
Calling `asyncio.run` multiple times could cause the test processes to
hang for strange event loop reasons. This commit converts most test
cases to be run in a single event loop managed by the default driver,
which is now async aware.
Not all tests could be converted, e.g. the test that runs an async
function in a sync context. However, the test suite does succeed with
these changes, and these tests can be further modified if needed.1 parent 8f48f1b commit 64dff42
2 files changed
+185
-218
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
0 commit comments