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

Fix faulthandler for Twisted Logger when used with "--capture=no" #8250

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Jan 17, 2021

Hi again,

this patch resolves #8249.

The background on this is that the Twisted Logger will return an invalid file descriptor since it is not backed by an FD. It will make pytest croak and hang when invoked through pytest --capture=no on teardown.

The solution is to also forward this to the same code path as with pytest-xdist, where the code already has special handling for.

Hereby, I humbly ask for further guidance in order to bring in this patch. Please let me know

  • if you prefer this mitigation to be handled differently.
  • if you think the respective test case should be adjusted.

With kind regards,
Andreas.

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Nice description and fix! LGTM, just a couple of comments.

changelog/8249.bugfix.rst Outdated Show resolved Hide resolved
testing/test_faulthandler.py Outdated Show resolved Hide resolved
@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Jan 18, 2021
The Twisted Logger will return an invalid file descriptor since it is
not backed by an FD. So, let's also forward this to the same code path
as with `pytest-xdist`.
@amotl amotl force-pushed the fix-twisted-capture branch from 849fa40 to 9ba1821 Compare January 18, 2021 16:51
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @amotl!

@nicoddemus nicoddemus merged commit bda9ce4 into pytest-dev:master Jan 20, 2021
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jan 20, 2021
@nicoddemus
Copy link
Member

Backport: #8259

@nicoddemus nicoddemus added backported and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Jan 20, 2021
@amotl
Copy link
Contributor Author

amotl commented Jan 23, 2021

Thank you for accepting this small improvement. I wish much success and kudos to all of you for the future development of pytest.

@amotl amotl deleted the fix-twisted-capture branch October 19, 2024 16:03
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.

Problem with faulthandler when used with Twisted Logger and "pytest --capture=no"
3 participants