From a57e6bbcc4674835fe8a1cbc0491573e8e08acae Mon Sep 17 00:00:00 2001 From: Andrei Dziahel Date: Thu, 23 Nov 2023 11:06:04 +0100 Subject: [PATCH] test/io: test random port assignment --- test/io/test_io.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/io/test_io.py b/test/io/test_io.py index 91b5421adae..65a72329933 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -196,6 +196,11 @@ def sleep(): t.join() +def test_random_port_bound(defaultenv): + "PostgREST should bind to a random port when PGRST_SERVER_PORT is 0." + + with run(env=defaultenv, port="0") as postgrest: + assert True # liveness check is done by run(), so we just need to check that it doesn't fail def test_app_settings_reload(tmp_path, defaultenv): "App settings should be reloaded from file when PostgREST is sent SIGUSR2."