mirror of
https://github.com/home-assistant/core.git
synced 2025-12-27 14:31:13 +00:00
Handle InnoDB deadlocks during migration (#89073)
* Handle slow InnoDB rollback when encountering duplicates during migration fixes #89069 * adjust * fix mock * tests * return on success
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
from datetime import datetime, timedelta
|
||||
import json
|
||||
import sqlite3
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.exc import DatabaseError, OperationalError
|
||||
@@ -192,7 +192,7 @@ async def test_purge_old_states_encounters_temporary_mysql_error(
|
||||
await async_wait_recording_done(hass)
|
||||
|
||||
mysql_exception = OperationalError("statement", {}, [])
|
||||
mysql_exception.orig = MagicMock(args=(1205, "retryable"))
|
||||
mysql_exception.orig = Exception(1205, "retryable")
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.recorder.util.time.sleep"
|
||||
|
||||
Reference in New Issue
Block a user