From 67a97a4d8adcde4727642ffc368763072d35f13a Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Thu, 12 Jul 2018 16:00:23 +0200 Subject: [PATCH] skip test if number of concurrent connections above default pg limit (#25252) --- tests/test_default_adapter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_default_adapter.py b/tests/test_default_adapter.py index 1b891bf..1833088 100644 --- a/tests/test_default_adapter.py +++ b/tests/test_default_adapter.py @@ -59,6 +59,14 @@ def test_lookup_user_transaction(transactional_db, concurrency): adapter = DefaultAdapter() p = ThreadPool(concurrency) + if connection.vendor == 'postgresql': + config_cur = connection.cursor() + config_cur.execute('SHOW max_connections') + max_connections = config_cur.fetchone()[0] + if int(max_connections) <= concurrency: + pytest.skip('Number of concurrent connections above postgresql maximum limit') + config_cur.close() + def f(i): # sqlite has a default lock timeout of 5s seconds between different access to the same in # memory DB -- 2.18.0