summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2018-07-12 14:00:23 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2018-07-18 16:07:24 (GMT)
commit349a4ec3bc700680d24d108d6dc241f04632669e (patch)
treeb7c0d49e829347965a80e8c3b89f307d819bab5e
parentc5fddd13cd41bb5aba85e64973e41cd0bc914300 (diff)
downloaddjango-mellon-349a4ec3bc700680d24d108d6dc241f04632669e.zip
django-mellon-349a4ec3bc700680d24d108d6dc241f04632669e.tar.gz
django-mellon-349a4ec3bc700680d24d108d6dc241f04632669e.tar.bz2
skip test if number of concurrent connections above default pg limit (#25252)
-rw-r--r--tests/test_default_adapter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_default_adapter.py b/tests/test_default_adapter.py
index 1b891bf..8cf4382 100644
--- a/tests/test_default_adapter.py
+++ b/tests/test_default_adapter.py
@@ -59,6 +59,13 @@ def test_lookup_user_transaction(transactional_db, concurrency):
adapter = DefaultAdapter()
p = ThreadPool(concurrency)
+ if connection.vendor == 'postgresql':
+ with connection.cursor() as c:
+ c.execute('SHOW max_connections')
+ max_connections = c.fetchone()[0]
+ if int(max_connections) <= concurrency:
+ pytest.skip('Number of concurrent connections above postgresql maximum limit')
+
def f(i):
# sqlite has a default lock timeout of 5s seconds between different access to the same in
# memory DB