Skip to content

Fix flaky test TestTableTTL::test_base: wait for TTL to be applied#681

Merged
koletzilla merged 2 commits into
mainfrom
ClickHouse/fix-flaky-ttl-checks
Jul 8, 2026
Merged

Fix flaky test TestTableTTL::test_base: wait for TTL to be applied#681
koletzilla merged 2 commits into
mainfrom
ClickHouse/fix-flaky-ttl-checks

Conversation

@koletzilla

@koletzilla koletzilla commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@koletzilla koletzilla requested a review from Copilot July 7, 2026 14:17
@koletzilla koletzilla changed the title Fix flaky test: wait for TTL to be replicated Fix flaky test TestTableTTL::test_base: wait for TTL to be replicated Jul 7, 2026

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 aims to fix flakiness in the ClickHouse TTL integration test (TestTableTTL::test_base) by forcing merges (via OPTIMIZE ... FINAL) and waiting until TTL-driven row removal is observable.

Changes:

  • Added a helper (assert_row_count_after_ttl) that runs OPTIMIZE ... FINAL and polls count(*) until the expected row count is reached (or a timeout occurs).
  • Updated both the single-node TTL test and the distributed-table TTL test to use the helper instead of single-shot assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/integration/adapter/clickhouse/test_clickhouse_table_ttl.py
Comment thread tests/integration/adapter/clickhouse/test_clickhouse_table_ttl.py
@koletzilla koletzilla marked this pull request as ready for review July 7, 2026 14:54
@koletzilla koletzilla changed the title Fix flaky test TestTableTTL::test_base: wait for TTL to be replicated Fix flaky test TestTableTTL::test_base: wait for TTL to be applied Jul 7, 2026
@koletzilla koletzilla requested a review from BentsiLeviav July 7, 2026 14:55
@koletzilla

Copy link
Copy Markdown
Contributor Author

Test failing in test_local_matrix to be fixed in #680

@koletzilla koletzilla merged commit 2ac96a1 into main Jul 8, 2026
13 of 15 checks passed
@koletzilla koletzilla deleted the ClickHouse/fix-flaky-ttl-checks branch July 8, 2026 15:30
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.

3 participants