-
Notifications
You must be signed in to change notification settings - Fork 30
prevent shutdown issues by making server thread daemonic #411
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
Conversation
Hi @alexrashed , Thanks for the PR, it looks good - this thread should not block when the process exits. Thank you, |
Could you please squash the two commits to one? Precommit bot added a fix to your commit. |
e62efdf
to
b14f3b5
Compare
b14f3b5
to
2424568
Compare
Thanks! I'll do a release soon and let you know about it. |
hi @alexrashed, Version 1.1.3 has just been released with your fix. Please give it a try if you can. Thanks again for your contribution, |
This is great, thanks a lot for merging the PR and creating a release! 🥳 |
Bumps [pytest-httpserver](https://github.com/csernazs/pytest-httpserver) from 1.1.2 to 1.1.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/releases">pytest-httpserver's releases</a>.</em></p> <blockquote> <h2>1.1.3</h2> <ul> <li>Run server threads with daemon flag, preventing shutdown issues. <a href="https://redirect.github.com/csernazs/pytest-httpserver/issues/411">#411</a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/blob/master/CHANGES.rst">pytest-httpserver's changelog</a>.</em></p> <blockquote> <h1>1.1.3</h1> <p>.. _Release Notes_1.1.3_Bug Fixes:</p> <h2>Bug Fixes</h2> <ul> <li>Run server threads with daemon flag, preventing shutdown issues. <code>[#411](csernazs/pytest-httpserver#411) <https://github.com/csernazs/pytest-httpserver/pull/411></code>_</li> </ul> <p>.. _Release Notes_1.1.2:</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/68b7ce56d640a9e40c03c7c914cead6193c84bc8"><code>68b7ce5</code></a> CHANGES.rst: add release notes for 1.1.3</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/7ae4709662e71d35e53c86930a3acda3cb8baf88"><code>7ae4709</code></a> Version bump to 1.1.3</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/a00d8a4a20029ce651bb9a99226747fbbd528268"><code>a00d8a4</code></a> releasenotes: add release note for <a href="https://redirect.github.com/csernazs/pytest-httpserver/issues/411">#411</a></li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/e9010dc0a42331a075828929d794944e57364157"><code>e9010dc</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/32a25e95dcc09a87a28036c8de3da55b1a17a4b6"><code>32a25e9</code></a> explicitly spawn daemon thread for http server</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/414173b8d22b92c32f8a294bf999909954713009"><code>414173b</code></a> build(deps-dev): bump the deps group with 5 updates</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/5acead44e5df4902b502e14a4e4b15e5b93b0061"><code>5acead4</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/97dba58fb28597762a2eba794ba4489e14aa2fdb"><code>97dba58</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/a0da3951da3763566761195c05891f967e3bc0d5"><code>a0da395</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/178ded6de4b0aa9d5138d72124341fdcb289f19a"><code>178ded6</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li>Additional commits viewable in <a href="https://github.com/csernazs/pytest-httpserver/compare/1.1.2...1.1.3">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Motivation
In the LocalStack test codebase we heavily use LocalStack to test integrations of our emulated AWS services. Thanks for the great project!
In the past we were facing issues with our integration tests timing out due to shutdowns being blocked. It turns out that some of the
pytest-httpserver
threads were not properly shut down. @bentsku fixed this by patching theHTTPServer
class to spawn a deamon thread to make sure that it cannot block the shutdown of the interpreter with localstack/localstack#10052.This patch broke with the latest release, as the
start
method was modified (which is why we did not upgrade to the latest version 1.1.2, but introduced an upper limit with localstack/localstack@01a97ba).This PR aims at fixing these issues upstream to prevent issues like this for other users, as well as to be able to remove the patch in our projects.
Changes