fix: request failures when work_mem is set on a role

This commit is contained in:
Laurence Isla
2026-06-04 21:25:50 +05:00
committed by Taimoor Zaeem
parent 627e8c07ab
commit 4dc7d84ff1
7 changed files with 47 additions and 5 deletions
+16
View File
@@ -1833,3 +1833,19 @@ def test_positive_pool_metric(defaultenv):
).group(1)
)
assert metrics >= 0
def test_work_mem_in_role_settings(defaultenv):
"Should work when setting work_mem on a role. See https://github.com/PostgREST/postgrest/issues/4955"
env = {
**defaultenv,
"PGRST_JWT_SECRET": SECRET,
}
headers = jwtauthheader({"role": "postgrest_test_work_mem"}, SECRET)
with run(env=env) as postgrest:
response = postgrest.session.post("/rpc/get_work_mem", headers=headers)
assert response.status_code == 200
assert response.text == '"3MB"'