From 07252fea0f0b128158c0f06b48e91eb0978e7c3b Mon Sep 17 00:00:00 2001 From: eezd Date: Mon, 2 Nov 2026 21:24:14 +0800 Subject: [PATCH] fix(ci): wait for the final PostgreSQL server before smoke tests --- scripts/ci.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ci.py b/scripts/ci.py index edd997e..6570c60 100644 --- a/scripts/ci.py +++ b/scripts/ci.py @@ -163,8 +163,9 @@ def smoke(build, label): run('docker', 'run', '-d', '--name', names['db'], *common, '-e', 'POSTGRES_PASSWORD=ci-only', '-e', 'POSTGRES_USER=ci', '-e', 'POSTGRES_DB=ci', 'postgres:18-alpine') run('docker', 'run', '-d', '--name', names['redis'], *common, 'redis:8-alpine') - wait_command('docker', 'exec', names['db'], 'pg_isready', '-U', 'ci', '-d', 'ci') - run('docker', 'exec', names['db'], 'psql', '-U', 'ci', '-d', 'ci', '-v', 'ON_ERROR_STOP=1', + # The initialization server accepts sockets before the CI database exists. + wait_command('docker', 'exec', names['db'], 'pg_isready', '-h', '127.0.0.1', '-U', 'ci', '-d', 'ci') + run('docker', 'exec', names['db'], 'psql', '-h', '127.0.0.1', '-U', 'ci', '-d', 'ci', '-v', 'ON_ERROR_STOP=1', '-c', 'CREATE EXTENSION IF NOT EXISTS pg_trgm') image = build['images']['backend']['local'] password_hash = run('docker', 'run', '--rm', '--network', 'none', image, 'python', '-c',