Skip to content

fix(e2e): use log-based wait strategy for Postgres container readiness - #48

Merged
pikann merged 2 commits into
feature/implement-e2e-testsfrom
copilot/sub-pr-47
Mar 25, 2026
Merged

pikann merged 2 commits into
feature/implement-e2e-testsfrom
copilot/sub-pr-47

Conversation

Copilot AI commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

wait.ForListeningPort for Postgres is flaky — the port accepts TCP connections before the DB finishes initialization and is ready to execute queries/run migrations.

Changes

  • test/e2e/api_flow_test.go: Replace wait.ForListeningPort("5432/tcp") with wait.ForLog("database system is ready to accept connections") for the Postgres container. This log line is emitted by Postgres only after full initialization.
// Before
WaitingFor: wait.ForListeningPort("5432/tcp").WithStartupTimeout(60 * time.Second),

// After
WaitingFor: wait.ForLog("database system is ready to accept connections").WithStartupTimeout(60 * time.Second),

Redis keeps ForListeningPort — it has no analogous initialization gap.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] [WIP] Address feedback on e2e tests implementation in original PR fix(e2e): use log-based wait strategy for Postgres container readiness Mar 25, 2026
Copilot AI requested a review from pikann March 25, 2026 08:12
@pikann
pikann marked this pull request as ready for review March 25, 2026 08:16
@pikann
pikann merged commit 1d3e723 into feature/implement-e2e-tests Mar 25, 2026
4 checks passed
@pikann
pikann deleted the copilot/sub-pr-47 branch March 25, 2026 08:16
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.

2 participants