From f4a81a8b5b4a353ea53db3cf2c7f52ecafcf5f33 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 9 Feb 2023 08:27:27 -0600 Subject: [PATCH] Disable test_migration_in_progress on MySQL (#87765) This test was recently enabled on MySQL in https://github.com/home-assistant/core/pull/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 --- tests/components/recorder/test_migrate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/components/recorder/test_migrate.py b/tests/components/recorder/test_migrate.py index e9c0b8cba44..557aa67c575 100644 --- a/tests/components/recorder/test_migrate.py +++ b/tests/components/recorder/test_migrate.py @@ -77,6 +77,14 @@ async def test_schema_update_calls(hass: HomeAssistant, recorder_db_url: str) -> async def test_migration_in_progress(hass: HomeAssistant, recorder_db_url: str) -> None: """Test that we can check for migration in progress.""" + if recorder_db_url.startswith("mysql://"): + # The database drop at the end of this test currently hangs on MySQL + # because the post migration is still in progress in the background + # which results in a deadlock in InnoDB. This behavior is not likely + # to happen in real life because the database does not get dropped + # in normal operation. + return + assert recorder.util.async_migration_in_progress(hass) is False with patch("homeassistant.components.recorder.ALLOW_IN_MEMORY_DB", True), patch(