fix: consider authentication failure as a fatal error
This commit is contained in:
+11
-1
@@ -50,6 +50,7 @@ def run(
|
||||
env=None,
|
||||
port=None,
|
||||
host=None,
|
||||
wait_for_readiness=True,
|
||||
no_pool_connection_available=False,
|
||||
):
|
||||
"Run PostgREST and yield an endpoint that is ready for connections."
|
||||
@@ -88,7 +89,8 @@ def run(
|
||||
process.stdin.write(stdin or b"")
|
||||
process.stdin.close()
|
||||
|
||||
wait_until_ready(adminurl + "/ready")
|
||||
if wait_for_readiness:
|
||||
wait_until_ready(adminurl + "/ready")
|
||||
|
||||
process.stdout.read()
|
||||
|
||||
@@ -137,6 +139,14 @@ def freeport():
|
||||
return s.getsockname()[1]
|
||||
|
||||
|
||||
def wait_until_exit(postgrest):
|
||||
"Wait for PostgREST to exit, or times out"
|
||||
try:
|
||||
return postgrest.process.wait(timeout=1)
|
||||
except (subprocess.TimeoutExpired):
|
||||
raise PostgrestTimedOut()
|
||||
|
||||
|
||||
def wait_until_ready(url):
|
||||
"Wait for the given HTTP endpoint to return a status of 200."
|
||||
session = requests_unixsocket.Session()
|
||||
|
||||
Reference in New Issue
Block a user