From: Daniele Varrazzo Date: Sat, 6 Mar 2021 02:08:54 +0000 (+0100) Subject: Fix concurrency test X-Git-Tag: 3.0.dev0~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1216fc995c68729131951c54fdd9dbdce2771a7e;p=thirdparty%2Fpsycopg.git Fix concurrency test It was blocking because the committer was a too busy loop never yielding to the other worker. --- diff --git a/tests/test_concurrency_async.py b/tests/test_concurrency_async.py index a75e09f71..c6fbe4c90 100644 --- a/tests/test_concurrency_async.py +++ b/tests/test_concurrency_async.py @@ -9,7 +9,7 @@ pytestmark = pytest.mark.asyncio @pytest.mark.slow -@pytest.mark.skip # TODO: sometimes this test hangs? +@pytest.mark.skip async def test_commit_concurrency(aconn): # Check the condition reported in psycopg2#103 # Because of bad status check, we commit even when a commit is already on @@ -24,6 +24,7 @@ async def test_commit_concurrency(aconn): nonlocal stop while not stop: await aconn.commit() + await asyncio.sleep(0) # Allow the other worker to work async def runner(): nonlocal stop