fix(qa): 为候选库验收预留连接容量
build / build (push) Successful in 2m9s

This commit is contained in:
姚章浩
2026-11-25 01:09:01 +08:00
parent bb57a9835c
commit 7926c8e8b9
2 changed files with 21 additions and 0 deletions
+11
View File
@@ -49,6 +49,12 @@ def qa_database(path):
return url, cert
def qa_process_command(role):
if role not in ('api', 'worker'):
raise ValueError('unexpected QA process')
return ['/bin/sh', '-ec', 'export DATABASE_URL="$${DATABASE_URL}&pool_max_conns=2"; exec /app/' + role]
def ready(directory, bundle, test_database=None):
bundle = bundle.resolve()
manifest = cd.read_json(bundle / 'release.json')
@@ -99,6 +105,11 @@ def ready(directory, bundle, test_database=None):
if test_database is None:
services['api']['depends_on'] = {'postgres': {'condition': 'service_healthy'}}
services['worker'].update(command=['/app/worker'], depends_on={'api': {'condition': 'service_healthy'}})
if test_database is not None:
# Apply the pgx budget to the application process. The independent libpq
# migration probe reads the original, TLS-verified DSN from Docker exec.
for role in ('api', 'worker'):
services[role]['command'] = qa_process_command(role)
services['web'].update(ports=['127.0.0.1::8080'], depends_on={'api': {'condition': 'service_healthy'}})
internal_subnet = isolated_subnet()
networks = {'default': {'internal': test_database is None, 'ipam': {'config': [{'subnet': internal_subnet}]}}}