From: Daniele Varrazzo Date: Wed, 21 May 2025 09:34:50 +0000 (+0200) Subject: fix(test): wait for thread end before reading process stdout X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a02e5922cc19ad965277bd0cdea11655279acf48;p=thirdparty%2Fpsycopg.git fix(test): wait for thread end before reading process stdout Should solve what seems a race condition on PyPy and free-threaded Python (see #1096). --- diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index 4b5b760c8..0fe8f3f37 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -558,10 +558,10 @@ def test_break_attempts(dsn, proxy): proc.send_signal(signal.SIGINT) proc.wait() t1 = time.time() + t.join() # Check that we didn't try the second attempt assert t1 - t0 < 2.5 assert proc.returncode != 0 - if sys.implementation.name != "pypy": # unexpected, but hey. - assert "KeyboardInterrupt" in stderr + assert "KeyboardInterrupt" in stderr assert stdout == ""