mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Explicitly set max_connections to 100 for Python test cases to fit Git action MacOS test cases
This commit is contained in:
parent
cede5cf899
commit
6d399f4fd7
@ -50,8 +50,23 @@ COVERAGE_CONFIG_FILE = os.path.join(CURRENT_PATH, ".coveragerc")
|
||||
file_name = os.path.realpath(__file__)
|
||||
|
||||
|
||||
def get_db_connection(db, username, password, host, port, sslmode="prefer"):
|
||||
def get_db_connection(db, username, password, host, port, sslmode="prefer",
|
||||
max_connections=None):
|
||||
"""This function returns the connection object of psycopg"""
|
||||
if max_connections:
|
||||
with psycopg.connect(
|
||||
dbname=db,
|
||||
user=username,
|
||||
password=password,
|
||||
host=host,
|
||||
port=port,
|
||||
sslmode=sslmode,
|
||||
autocommit=True,
|
||||
) as conn:
|
||||
cur = conn.cursor()
|
||||
cur.execute('ALTER SYSTEM SET max_connections TO 100;')
|
||||
cur.execute('SELECT pg_reload_conf();')
|
||||
|
||||
connection = psycopg.connect(
|
||||
dbname=db,
|
||||
user=username,
|
||||
|
@ -496,7 +496,8 @@ def execute_test(test_module_list_passed, server_passed, driver_passed,
|
||||
server_passed['db_password'],
|
||||
server_passed['host'],
|
||||
server_passed['port'],
|
||||
server_passed['sslmode']
|
||||
server_passed['sslmode'],
|
||||
max_connections=100
|
||||
)
|
||||
|
||||
# Add the server version in server information
|
||||
|
Loading…
Reference in New Issue
Block a user