Skip to content

fix blockon forrever lock #24

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 1 commit into from
Mar 8, 2018
Merged

fix blockon forrever lock #24

merged 1 commit into from
Mar 8, 2018

Conversation

ybilopolov
Copy link
Contributor

After last update second call to blockon will lock forever as reactor in greenlet is already running. This PL fixes the issue.

@vtitor
Copy link
Member

vtitor commented Mar 8, 2018

@ybilopolov Thanks for this!

@vtitor vtitor merged commit 9e20653 into pytest-dev:master Mar 8, 2018
Copy link
Member

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is _config.external_reactor referring to the use of qt5reactor as being 'external'? Or to the user having created a reactor without using the provided fixture?

reactor.callLater(0.01, d.callback, 1)
reactor.callLater(0.02, d2.callback, 1)
pt.blockon(d)
pt.blockon(d)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally blocking on d twice and ignoring d2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just typo, thanks for noticing

@ybilopolov
Copy link
Contributor Author

@altendky, _config.external_reactor is referring to the case when pytest itself is being run in a thread inside a running twisted application, so that we can't and don't need to run another reactor in a greenlet, but should use blockingCallFromThread instead. test_pytest_from_reactor_thread is an example of such case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants