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

"Task was destroyed but is pending!" error in tests #9

Closed
benjamin-hodgson opened this issue Nov 9, 2014 · 3 comments
Closed

"Task was destroyed but is pending!" error in tests #9

benjamin-hodgson opened this issue Nov 9, 2014 · 3 comments
Assignees
Labels

Comments

@benjamin-hodgson
Copy link
Owner

Some - not all - tests print Task was destroyed but is pending! for some reason.

This doesn't seem to happen during the integration tests, which suggests that it's a problem with the fixture in the unit tests not tearing itself down properly.

$ run-contexts -v test/connection_tests.py:WhenRespondingToConnectionStart
When responding to connection start
  PASS: it should send start ok
----------------------------------------------------------------------
PASSED!
1 context, 1 assertion
(0.0 seconds)
Task was destroyed but it is pending!
task: <Task pending coro=<read_next() running at /Users/ben/Developer/asynqp/src/asynqp/bases.py:48>>
Task was destroyed but it is pending!
task: <Task pending coro=<open_connection() running at /Users/ben/Developer/asynqp/src/asynqp/connection.py:97> wait_for=<Future cancelled>>

This might have been due to a Python update; previous Travis builds don't exhibit this error, but the same code running on my box does.

@benjamin-hodgson benjamin-hodgson self-assigned this Nov 9, 2014
@benjamin-hodgson
Copy link
Owner Author

See this commit to the Python repo which introduced the error messaging. I think this change made it into Python 3.4.2 but not 3.4.1. I guess Travis updated its build environment in the last week or so.

In any case, I think this error is either a) spurious, or b) surfacing a long-standing problem with asynqp. If b) it needs to be fixed, obviously; if a) then the error should be silenced for the tests.

@benjamin-hodgson
Copy link
Owner Author

Temporarily fixed in commit 0159e23. Leaving this issue open because the hack needs to be resolved.

@renatomassaro
Copy link
Contributor

I was having the same issue using a code very similar to the repository example, but making use of consume instead of queue.get(). I thought this could be the reason but the same error happened with queue.get(), so the example on the README has this issue on python==3.4.2.

Closing the channel before closing the connection fixed this for me. I'll submit a PR with the README change.

benjamin-hodgson pushed a commit that referenced this issue Mar 27, 2015
Update README.md according to #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants