Skip to content

[3.6] bpo-31250: test_asyncio: fix dangling threads #3517

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

Merged
merged 2 commits into from
Sep 12, 2017
Merged

[3.6] bpo-31250: test_asyncio: fix dangling threads #3517

merged 2 commits into from
Sep 12, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 12, 2017

* Explicitly call shutdown(wait=True) on executors to wait until all
  threads complete to prevent side effects between tests.
* Fix test_loop_self_reading_exception(): don't mock loop.close().
  Previously, the original close() method was called rather than the
  mock, because how set_event_loop() registered loop.close().

(cherry picked from commit 16432be)
Call doCleanups() to close the loop after calling
executor.shutdown(wait=True): see TestCase.set_event_loop() of
asyncio.test_utils.

Replace also gc.collect() with support.gc_collect().

(cherry picked from commit e8a533f)
@miss-islington
Copy link
Contributor

Thanks, @Haypo!

@vstinner vstinner deleted the asyncio36 branch September 12, 2017 21:18
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.

5 participants