Skip to content

fix: replace fixed sleep with polling loop in test 22 to fix CI race condition - #48

Merged
Pino de Candia (pinodeca) merged 1 commit into
mainfrom
pinodeca/fix-test-22
Mar 10, 2026
Merged

Pino de Candia (pinodeca) merged 1 commit into
mainfrom
pinodeca/fix-test-22

Conversation

@pinodeca

Copy link
Copy Markdown
Contributor

Test 22 (cross_connection) was flaky in CI because it used a fixed pg_sleep(2) before asserting that the loop had completed at least one iteration. On slower CI runners, the background worker hadn't committed the INSERT yet.

Fix: Replace the fixed sleep + immediate check with a polling loop that waits up to 10s for the first loop iteration row to appear in cross_conn_log.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a CI race condition in E2E test 22 (cross_connection.sql) where a fixed pg_sleep(2) was insufficient on slower CI runners, causing the test to fail because the background worker hadn't committed the first loop iteration INSERT yet.

Changes:

  • Replaces SELECT pg_sleep(2) with a polling loop (up to ~10s, checking every 100ms) that waits for cross_conn_log to contain at least one loop_iteration row before proceeding with assertions.
  • Updates the failure error message to mention the timeout context.

Comment thread tests/e2e/sql/22_cross_connection.sql
@pinodeca
Pino de Candia (pinodeca) merged commit 03ddbab into main Mar 10, 2026
9 checks passed
@pinodeca
Pino de Candia (pinodeca) deleted the pinodeca/fix-test-22 branch March 10, 2026 18:21
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