File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -580,6 +580,7 @@ async def retry_converting_records(
580580 async def fail_upgrade ():
581581 async with profile .session () as session :
582582 storage = session .inject (BaseStorage )
583+ UpgradeInProgressSingleton ().remove_wallet (profile .name )
583584 await storage .delete_record (upgrading_record )
584585
585586 try :
@@ -597,7 +598,8 @@ async def fail_upgrade():
597598 else :
598599 LOGGER .error (
599600 f"Failed to upgrade wallet: { profile .name } after 5 retries. "
600- "Try fixing any connection issues and re-running the update"
601+ "Try fixing any connection issues or repairing the wallet and re-running "
602+ "the update"
601603 )
602604 await fail_upgrade ()
603605
Original file line number Diff line number Diff line change 2727from ...tests import mock
2828from ...utils .testing import create_test_profile
2929from .. import anoncreds_upgrade
30+ from ..singletons import UpgradeInProgressSingleton
3031
3132
3233class TestAnonCredsUpgrade (IsolatedAsyncioTestCase ):
@@ -361,11 +362,15 @@ async def test_failed_upgrade(self):
361362 Exception ("Error" ),
362363 ]
363364 )
365+ # Add wallet to upgrade in progress singleton
366+ UpgradeInProgressSingleton ().set_wallet (self .profile .name )
364367 await anoncreds_upgrade .upgrade_wallet_to_anoncreds_if_requested (
365368 self .profile
366369 )
367370 assert mock_rollback .called
368371 assert not mock_commit .called
372+ # Verify wallet has been removed from singleton
373+ assert self .profile .name not in UpgradeInProgressSingleton ().wallets
369374 # Upgrading record should not be deleted
370375 with self .assertRaises (Exception ):
371376 await storage .find_record (
You can’t perform that action at this time.
0 commit comments