Ensure MySQL tests cleanup connections and raise an exception if they do not#87767
Merged
Conversation
Was just enabled in home-assistant#87756 (comment) but not yet ready as it is still failing on the CI
This test was recently enabled on MySQL in home-assistant#87753 Since it the migration is still in progress in the background when the test ends, it causes deadlock with InnoDB when its dropped out from under it
Dropping the database after this test will fail on MySQL and hang forever because it causes an InnoDB deadlock ``` | 2042 | root | localhost:52698 | NULL | Query | 41 | Waiting for table metadata lock | DROP DATABASE `homeassistant-test` | 0.000 | ```
Contributor
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
epenet
approved these changes
Feb 9, 2023
Contributor
epenet
left a comment
There was a problem hiding this comment.
Makes sense, LGTM 👍
cc @emontnemery
bdraco
commented
Feb 9, 2023
emontnemery
requested changes
Feb 9, 2023
Contributor
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
19 tasks
Contributor
|
#87760 was merged, triggering fresh run now. |
19 tasks
If the final commit in _end_session raised, we would never close the event session which would leave the connection open leading to an unclean shutdown
bdraco
commented
Feb 9, 2023
AlePerla
pushed a commit
to AlePerla/homeassistant_core
that referenced
this pull request
Feb 10, 2023
… do not (home-assistant#87767) Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Erik <erik@montnemery.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Fixes a few tests not cleaning up connections.
We now raise an exception when a test fails to fully cleanup.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: