fix: request failures when work_mem is set on a role
This commit is contained in:
committed by
Taimoor Zaeem
parent
627e8c07ab
commit
4dc7d84ff1
@@ -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"'
|
||||
|
||||
Reference in New Issue
Block a user