fix: not logging termination unix signals
Under container environments like ECS, it's hard to know when PostgREST is being terminated.
This commit is contained in:
@@ -105,6 +105,24 @@ def test_flush_pool_no_interrupt(defaultenv):
|
||||
t.join()
|
||||
|
||||
|
||||
def test_termination_unix_signal_logging(defaultenv):
|
||||
"Server logs when handling termination unix signals."
|
||||
|
||||
with run(env=defaultenv) as postgrest:
|
||||
postgrest.process.send_signal(signal.SIGTERM)
|
||||
lines = postgrest.read_stdout(nlines=1)
|
||||
wait_until_exit(postgrest)
|
||||
|
||||
assert any("SIGTERM" in line for line in lines)
|
||||
|
||||
with run(env=defaultenv) as postgrest:
|
||||
postgrest.process.send_signal(signal.SIGINT)
|
||||
lines = postgrest.read_stdout(nlines=1)
|
||||
wait_until_exit(postgrest)
|
||||
|
||||
assert any("SIGINT" in line for line in lines)
|
||||
|
||||
|
||||
def test_random_port_bound(defaultenv):
|
||||
"PostgREST should bind to a random port when PGRST_SERVER_PORT is 0."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user