refactor: deduplicate host resolution logic and observations

Replaces the "API server listening on unix socket" with simpler
"API server listening on " observation. This allows refactoring
redundant code.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2025-09-01 15:00:20 -05:00
committed by Steve Chavez
parent ef9ac61d9e
commit 41b6ebea58
6 changed files with 46 additions and 44 deletions
+1 -1
View File
@@ -1378,7 +1378,7 @@ def test_log_postgrest_host_and_port(host, defaultenv):
output = postgrest.read_stdout(nlines=10)
if is_unix:
re.match(r'API server listening on unix socket "/tmp/.*\.sock"', output[2])
re.match(r'API server listening on "/tmp/.*\.sock"', output[2])
elif is_ipv6(host):
assert f"API server listening on [{host}]:{port}" in output[2]
else: # IPv4