This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Guido.van.Rossum, Richard.Kiss, giampaolo.rodola, gvanrossum, pitrou, python-dev, richard.kiss, vstinner, yselivanov
Date 2014-06-25.22:27:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403735231.07.0.25845889593.issue21163@psf.upfronthosting.co.za>
In-reply-to
Content
I fixed the first "Task was destroyed but it is pending!" messages when the fix was simple.

Attached dont_log_pending.patch fixes remaining messages when running test_asyncio. I'm not sure yet that this patch is the best approach to fix the issue.


Modified functions with example of related tests:


* BaseEventLoop.run_until_complete(): don't log because there the method already raises an exception if the future didn't complete ("Event loop stopped before Future completed.")

=> related test: test_run_until_complete_stopped() of test_events.py


* wait(): don't log because the caller doesn't have control on the internal sub-tasks, and the task executing wait() will already emit a message if it is destroyed whereas it didn't completed

=> related test: test_wait_errors() of test_tasks.py


* gather(): same rationale than wait()

=> related test: test_one_exception() of test_tasks.py


* test_utils.run_briefly(): the caller doesn't have access to the task and the function is a best effort approach, it doesn't have to guarantee that running a step of the event loop is until to execute all pending callbacks

=> related test: test_baseexception_during_cancel() of test_tasks.py
History
Date User Action Args
2014-06-25 22:27:11vstinnersetrecipients: + vstinner, gvanrossum, pitrou, giampaolo.rodola, python-dev, yselivanov, Guido.van.Rossum, richard.kiss, Richard.Kiss
2014-06-25 22:27:11vstinnersetmessageid: <1403735231.07.0.25845889593.issue21163@psf.upfronthosting.co.za>
2014-06-25 22:27:11vstinnerlinkissue21163 messages
2014-06-25 22:27:10vstinnercreate