Skip to content

Wait for PostgreSQL readiness before local start success - #498

Open
sdairs wants to merge 6 commits into
issue-460-postgres-preflight-validationfrom
issue-457-postgres-readiness-v2
Open

Wait for PostgreSQL readiness before local start success#498
sdairs wants to merge 6 commits into
issue-460-postgres-preflight-validationfrom
issue-457-postgres-readiness-v2

Conversation

@sdairs

@sdairs sdairs commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Wait for pg_isready inside the managed container before fresh and resumed local Postgres starts print credentials or return success.
  • Bound readiness at 30 seconds, keep the probe detached from CLI stdio, and include the last 50 container log lines for immediate exits and timeouts.
  • Return readiness failures through the normal command error path so telemetry records failure; clean up failed fresh starts and stop failed resumed starts for retry.
  • Add deterministic fake-Docker unit and subprocess coverage, and make the Docker integration script rely on the start readiness guarantee.

Tests

  • cargo test -p clickhousectl (754 passed)
  • cargo test -p clickhousectl postgres_readiness (focused readiness coverage passed)
  • cargo test -p clickhousectl --test local_postgres_readiness_test (3 passed)
  • cargo clippy -p clickhousectl --all-targets -- -D warnings (passed)
  • cargo build -p clickhousectl (passed)
  • cargo fmt --all -- --check (passed)
  • CI local postgres edge cases Docker integration (passed)
  • Local Docker integration not run: configured OrbStack socket was unavailable

Stack

Position 2 of 2 (top), based on #486.

Closes #457

@sdairs sdairs changed the title issue 457 postgres readiness v2 Wait for PostgreSQL readiness before local start success Aug 24, 2026
Comment thread crates/clickhousectl/src/local/postgres.rs Outdated
Comment thread crates/clickhousectl/src/local/postgres.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wait for PostgreSQL readiness before reporting local start success

1 participant