Projet

Général

Profil

0001-skip-test-if-number-of-concurrent-connections-above-.patch

Paul Marillonnet, 12 juillet 2018 16:05

Télécharger (1,15 ko)

Voir les différences:

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(+)
tests/test_default_adapter.py
59 59
    adapter = DefaultAdapter()
60 60
    p = ThreadPool(concurrency)
61 61

  
62
    if connection.vendor == 'postgresql':
63
        config_cur = connection.cursor()
64
        config_cur.execute('SHOW max_connections')
65
        max_connections = config_cur.fetchone()[0]
66
        if int(max_connections) <= concurrency:
67
            pytest.skip('Number of concurrent connections above postgresql maximum limit')
68
        config_cur.close()
69

  
62 70
    def f(i):
63 71
        # sqlite has a default lock timeout of 5s seconds between different access to the same in
64 72
        # memory DB
65
-