fix: don't mention retrying in the database connection error message
The PGRST000 database connection error message was "Database connection error. Retrying the connection.", but reconnection attempts are already logged separately by the reconnection observation, and on fatal errors (e.g. authentication failure) PostgREST does not retry at all. Drop the "Retrying the connection." part, leaving "Database connection error.".
This commit is contained in:
@@ -1756,6 +1756,15 @@ def test_log_listener_connection_start(defaultenv):
|
||||
)
|
||||
|
||||
|
||||
def test_connection_error_message_does_not_claim_retry(defaultenv):
|
||||
"The connection error message should not claim retrying, since PostgREST stops on fatal errors."
|
||||
uri = f'postgresql://?dbname={defaultenv["PGDATABASE"]}&host={defaultenv["PGHOST"]}&user=some_protected_user&password=invalid_pass'
|
||||
env = {**defaultenv, "PGRST_DB_URI": uri}
|
||||
with run(env=env, no_startup_stdout=False, wait_for=None) as postgrest:
|
||||
output = postgrest.read_stdout(nlines=8)
|
||||
assert any('"message":"Database connection error."' in line for line in output)
|
||||
|
||||
|
||||
def test_db_pre_config_with_pg_reserved_words(defaultenv):
|
||||
"The db-pre-config should not fail unexpectedly when function name is a postgres reserved word"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user