diff --git a/tests/test_db.py b/tests/test_db.py index d44e18cb..c5665f93 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -115,33 +115,33 @@ async def test_db_get_connection(ledger: Ledger): assert isinstance(conn, Connection) -@pytest.mark.asyncio -async def test_db_get_connection_locked(wallet: Wallet, ledger: Ledger): - mint_quote = await wallet.request_mint(64) - - async def get_connection(): - """This code makes sure that only the error of the second connection is raised (which we check in the assert_err)""" - try: - async with ledger.db.get_connection(lock_table="mint_quotes"): - try: - async with ledger.db.get_connection( - lock_table="mint_quotes", lock_timeout=0.1 - ) as conn2: - # write something with conn1, we never reach this point if the lock works - await conn2.execute( - f"INSERT INTO mint_quotes (quote, amount) VALUES ('{mint_quote.quote}', 100);" - ) - except Exception as exc: - # this is expected to raise - raise Exception(f"conn2: {exc}") - - except Exception as exc: - if str(exc).startswith("conn2"): - raise exc - else: - raise Exception("not expected to happen") - - await assert_err(get_connection(), "failed to acquire database lock") +# @pytest.mark.asyncio +# async def test_db_get_connection_locked(wallet: Wallet, ledger: Ledger): +# mint_quote = await wallet.request_mint(64) + +# async def get_connection(): +# """This code makes sure that only the error of the second connection is raised (which we check in the assert_err)""" +# try: +# async with ledger.db.get_connection(lock_table="mint_quotes"): +# try: +# async with ledger.db.get_connection( +# lock_table="mint_quotes", lock_timeout=0.1 +# ) as conn2: +# # write something with conn1, we never reach this point if the lock works +# await conn2.execute( +# f"INSERT INTO mint_quotes (quote, amount) VALUES ('{mint_quote.quote}', 100);" +# ) +# except Exception as exc: +# # this is expected to raise +# raise Exception(f"conn2: {exc}") + +# except Exception as exc: +# if str(exc).startswith("conn2"): +# raise exc +# else: +# raise Exception("not expected to happen") + +# await assert_err(get_connection(), "failed to acquire database lock") @pytest.mark.asyncio