Skip to content

Commit

Permalink
Add max_connections to restart param test
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed May 20, 2024
1 parent f99e407 commit 52c868c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ async def test_postgresql_parameters_change(ops_test: OpsTest) -> None:
"memory_max_prepared_transactions": "100",
"memory_shared_buffers": "128",
"response_lc_monetary": "en_GB.utf8",
"experimental_max_connections": "200",
})
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", idle_period=30)
any_unit_name = ops_test.model.applications[DATABASE_APP_NAME].units[0].name
Expand All @@ -186,7 +187,12 @@ async def test_postgresql_parameters_change(ops_test: OpsTest) -> None:
with psycopg2.connect(
f"dbname='postgres' user='operator' host='{host}' password='{password}' connect_timeout=1"
) as connection, connection.cursor() as cursor:
settings_names = ["max_prepared_transactions", "shared_buffers", "lc_monetary"]
settings_names = [
"max_prepared_transactions",
"shared_buffers",
"lc_monetary",
"max_connections",
]
cursor.execute(
sql.SQL("SELECT name,setting FROM pg_settings WHERE name IN ({});").format(
sql.SQL(", ").join(sql.Placeholder() * len(settings_names))
Expand All @@ -200,6 +206,7 @@ async def test_postgresql_parameters_change(ops_test: OpsTest) -> None:
assert settings["max_prepared_transactions"] == "100"
assert settings["shared_buffers"] == "128"
assert settings["lc_monetary"] == "en_GB.utf8"
assert settings["max_connections"] == "200"
finally:
connection.close()

Expand Down

0 comments on commit 52c868c

Please sign in to comment.