]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Skip tests using the deaf_port fixture on macOS and Windows
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 5 Jan 2022 20:52:55 +0000 (21:52 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 5 Jan 2022 22:01:58 +0000 (23:01 +0100)
They fail some 50% of the time, looks like the port is not really
listening, the fact that the function is called listen() is just a
practical joke.

https://github.com/psycopg/psycopg/runs/4719288041?check_suite_focus=true

tests/fix_proxy.py

index ba39786fc6ade637716ff831b70e30be16299b86..01e384f50e5f0c4007c091f68172d3b35e55f437 100644 (file)
@@ -12,7 +12,11 @@ from psycopg import conninfo
 
 def pytest_collection_modifyitems(items):
     for item in items:
-        if "proxy" in item.fixturenames:
+        # TODO: there is a race condition on macOS and Windows in the CI:
+        # listen returns before really listening and tests based on 'deaf_port'
+        # fail 50% of the times. Just add the 'proxy' mark on these tests
+        # because they are already skipped in the CI.
+        if "proxy" in item.fixturenames or "deaf_port" in item.fixturenames:
             item.add_marker(pytest.mark.proxy)