steve-chavez
bfa4e1bedb
test: isolate pg_terminate_backend to appname
...
The pg_terminate_backend done in the io test:
`test_fail_with_automatic_recovery_disabled_and_terminated_using_query`
Can affect other connections.
2024-05-19 19:58:27 -05:00
steve-chavez
ae91fd89b3
test: assert empty response text on 204
2024-05-19 13:44:23 -05:00
steve-chavez
d25df459ea
feat: add metric label for scache load
...
localhost:3001/metrics now includes:
pgrst_schema_cache_loads_total{status="FAIL"} 352.0
pgrst_schema_cache_loads_total{status="SUCCESS"} 3.0
This allows testing the failure case on:
https://github.com/PostgREST/postgrest/issues/3424#issuecomment-2104904910
2024-05-14 17:57:21 -05:00
Wolfgang Walther and Wolfgang Walther
71885bdba6
test: Avoid freeport() collisions in io tests
...
It's very unlikely, but it can (and did) happen that both the server and
admin ports have the same number returned from freeport(). This then
leads to a situation where PostgREST will accept the same port in both
cases, because the host "localhost" will allow binding to ipv4 or ipv6
respectively. This will make the IO tests fail.
This change makes sure that the admin port will never be the same as the
server port and thus avoids this problem.
2024-05-12 11:45:06 +02:00
Wolfgang Walther and Wolfgang Walther
8392357863
test: Fix internal_schema_cache_sleep after 747c78f6
...
The $subject commit broke internal_schema_cache_sleep for other tests.
This reverts the order change, but keeps the scaling by x1000 to ms and
thus changes other users of this setting to the new scale.
2024-05-12 11:44:43 +02:00
Wolfgang Walther and Wolfgang Walther
747c78f6f4
test: Prevent test_admin_ready_includes_schema_cache_state from timing out
...
By increasing the delays in this test by factor 400x, postgrest will not
swamp pg with connection retries after the failed schema cache anymore.
This would happen because there is no backoff included after fatal
errors. Once it does, the io tests hang indefinitely in CI.
2024-05-09 13:36:03 +02:00
Wolfgang Walther and Wolfgang Walther
e96e16fa27
test: Reset statement timeout after each test
...
The statement timeout needs to be cleaned up after each test that
modifies it instead of before the test. Otherwise the changed timeout
leaks into other tests.
2024-05-09 13:36:03 +02:00
steve-chavez
0060abeb01
feat: /live and /ready respond with 500 on failure
...
503 is still used by /ready to indicate a transient state
that can be recovered from.
2024-05-08 17:19:48 -05:00
steve-chavez
d9a51f23ce
test: sanity tests for primary and replica
...
* new --replica option to `postgrest-with-postgresql-*`
* new command `postgrest-test-replica`
* new sanity tests on test_replica.py
* add postgrest-test-replica to postgrest-check and postgrest-coverage
2024-04-30 18:35:40 -05:00
steve-chavez
cdb877135b
test: flush stdout so readline doesn't hang
2024-04-30 13:52:51 -05:00
steve-chavez
357400b2b8
feat: schema cache metrics
2024-04-23 19:08:37 -05:00
steve-chavez
653c7955b2
feat: connection pool metrics in admin server
2024-04-23 19:08:37 -05:00
steve-chavez
3e615bd0d9
feat: add log-level=debug
2024-04-22 21:36:29 -05:00
Wolfgang Walther
87a463f857
test: fix broken io tests after last commit
...
Forgot to update the snapshots.
2024-04-20 16:03:53 +02:00
Wolfgang Walther
ed407350ad
fix: hoist function settings with memory units properly
...
f9ee1f7e introduced the hoisting of function settings as transaction-scoped
settings. However, this currently doesn't work with memory units, which are
case-sensitive according to the docs [1]. This removes the lowercasing of
values to make them work.
This is not added to the CHANGELOG, because this feature was not released, yet.
[1]: https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-NAMES-VALUES
2024-04-20 13:58:04 +02:00
steve-chavez
1bf0c54dd6
feat: log connection pool events on log-level=info
2024-04-15 18:31:51 -05:00
Steve Chavez and GitHub
9d1dc783bf
test: use postgrest.read_stdout in io tests ( #3412 )
...
It's easier to maintain this way in case there are new log lines.
2024-04-15 13:51:23 -05:00
Laurence Isla and GitHub
460259548d
perf: fix space leaks by downgrading fuzzyset to v0.2.4
2024-04-11 14:13:20 -05:00
steve-chavez
3d55f77bae
Revert "fix: slow responses on schema cache reload"
...
This reverts commit 727ef465c1 .
Also documents requests waiting for the schema cache.
2024-04-02 23:15:09 -05:00
Laurence Isla
378c11104b
test: fix some in-db config values
...
To correctly test in-db override of config file values, the former must be different from the latter.
2024-03-27 15:59:35 -05:00
Laurence Isla
428a6fef63
fix: in-db config values not loading for pgrst.server_trace_header and pgrst.server_cors_allowed_origins
2024-03-27 15:59:35 -05:00
steve-chavez
941ea0f929
test: notify do nothing
2024-03-19 13:22:51 +03:30
steve-chavez
ee8b3ef8fe
fix: log on LISTEN notification
2024-03-19 13:22:51 +03:30
steve-chavez
727ef465c1
fix: slow responses on schema cache reload
2024-03-15 11:53:29 -05:00
steve-chavez
11d8da046c
fix: incorrect /ready response on slow schema load
2024-03-15 11:03:01 -05:00
steve-chavez
4b289b1c97
test: requests wait for schema cache load
...
* nix: add postgrest-test-big-schema command
2024-03-15 06:18:26 -05:00
steve-chavez
92ac7e574e
chore: clarify concurrent notifications test
2024-03-14 23:17:05 -05:00
steve-chavez
ec7ab271d6
chore: add postgrest roles to big_schema.sql
2024-03-14 11:21:17 -05:00
Wolfgang Walther
0738785d72
test: Improve dump-schema snapshot test formatting
...
Splitting the output into separate files and adding top-level newlines makes this
much better to read and understand when looking at diffs.
Inspired by #1699
2024-02-24 14:01:19 +01:00
Wolfgang Walther and Wolfgang Walther
8a21a9c34e
fix: Dump media handlers and timezones with --dump-schema
...
Those were left out of the schema dump when the features were introduced, probably
because ByteString doesn't have a toJSON instance. Changing the type to Text solves
this easily.
Resolves #3237
2024-02-20 18:44:17 +01:00
Taimoor Zaeem and GitHub
32e1900370
feat: dump schema cache through admin API ( #3233 )
2024-02-19 21:20:29 -05:00
Andrei Dziahel and GitHub
3432f75ed4
fix: fixes server timings' precision ( #3227 )
...
* test: fix test_io accordingly
2024-02-14 12:26:34 -05:00
Taimoor Zaeem and Steve Chavez
f9ee1f7e73
feat: apply all function settings as transaction-scoped settings
2024-02-09 11:37:01 -05:00
Ivan Kasatenko and GitHub
71887e4b78
feat: dump config through Admin API
2024-02-05 19:16:05 -05:00
Laurence Isla and GitHub
4fb521cac6
fix: add jwt_cache_max_lifetime as an in-database configuration option ( #3102 )
2023-12-12 16:29:50 -05:00
Laurence Isla and Steve Chavez
dfa875c8c7
fix: do not log internal db errors like 'acquisition timeout' when log-level=crit
2023-11-27 23:06:40 -05:00
Laurence Isla and Steve Chavez
33891e3a73
feat: log all internal database errors to stderr
2023-11-27 23:06:40 -05:00
Andrei Dziahel and GitHub
df97a5071f
Display an actual TCP port app is bound to ( #3034 )
2023-11-23 18:17:16 -05:00
Tim Abdulla and GitHub
1c60b50e2e
Add aggregate functions ( #2925 )
...
The aggregate functions SUM(), MAX(), MIN(), AVG(), and COUNT() are now supported.
2023-11-23 14:03:03 -05:00
Andrei Dziahel and GitHub
c3301a1653
feat: implement server-timing-enabled config parameter ( #3064 )
2023-11-22 17:57:50 -05:00
steve-chavez
f7bf2157f3
feat: apply super settings on impersonated roles
...
If they have GRANT SET ON PARAMETER <setting> TO authenticator
2023-11-21 10:54:56 -05:00
Taimoor Zaeem and GitHub
125f10a60f
feat: add statement_timeout set on functions ( #3056 )
2023-11-17 12:36:51 -05:00
Taimoor Zaeem and GitHub
3c1a7f2641
feat: add timezone in Prefer header ( #3024 )
...
* increase reloading timeout in io-tests
* increase memory test by 1M
2023-11-13 14:16:27 -05:00
Laurence Isla
226400a5bc
break:remove the db-use-legacy-gucs config
...
BREAKING CHANGE
All PostgreSQL versions will use JSON GUCs for headers, cookies and JWT claims.
2023-11-02 15:50:22 -05:00
Laurence Isla and GitHub
b235227119
allow all origins when server-cors-allowed-origins is an empty string
2023-10-27 21:30:56 -05:00
steve-chavez
14d030b96c
break: remove binary field logic, raw-media-types
...
BREAKING CHANGE
Can be done later with custom media types
2023-10-26 09:04:02 -05:00
Taimoor Zaeem and GitHub
d94286c185
feat: add config to specify CORS origins ( #2986 )
2023-10-24 09:38:25 -05:00
steve-chavez
eb238ad678
test: DRY scache/config sleep in io tests
...
Also increase schema cache sleep to 0.2 as 0.1 tends to fail in CI.
2023-10-20 17:53:54 -05:00
Andrei Dziahel and GitHub
dc01c748ae
feat: add more perf counters to Server-Timing ( #2983 )
2023-10-12 09:55:30 -03:00
Taimoor Zaeem and Steve Chavez
3c1cdd434a
feat: add handling=strict/lenient for Prefer header
2023-09-27 15:00:52 -03:00