Skip to content

Fix flaky test_rabbitmq_mv_combo: keep polling while consumption progresses - #109892

Merged
pamarcos merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-flaky-test_rabbitmq_mv_combo-progress
Jul 9, 2026
Merged

pamarcos merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-flaky-test_rabbitmq_mv_combo-progress

Conversation

@groeneai

@groeneai groeneai commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

test_rabbitmq_mv_combo used a fixed 180s wall-clock deadline for the final row-count check. Consuming ~1 mln rows takes ~125s under thread sanitizer (8-13k rows/s), so on a loaded msan/tsan runner the deadline can be reached while consumption is still steadily progressing, producing a spurious pytest.fail at test.py:785.

Fix: reset the no-progress deadline whenever the total row count across the 5 materialized views increases, so the test only fails on a genuine stall. This mirrors the check_expected_result_polling helper already used by the other RabbitMQ streaming tests (added in #106200 / #107813).

CI evidence (test failed initially, passed on retry, retry_ok):

No related open issue found.

Version info

  • Merged into: 26.7.1.725 (included in 26.7 and later)

…resses

test_rabbitmq_mv_combo used a fixed 180s wall-clock deadline for the
row-count check. Consuming ~1 mln rows takes ~125s under thread sanitizer
(8-13k rows/s) and can exceed the deadline on a loaded runner while
consumption is still steadily progressing, causing a spurious
pytest.fail at test.py:785.

Reset the no-progress deadline whenever the total row count across the 5
materialized views increases, so the test only fails on a genuine stall.
This mirrors the check_expected_result_polling helper already used by the
other RabbitMQ streaming tests.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

groeneai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Partial. The failure is a slow-consumption timeout under sanitizer load (msan/tsan on loaded runners); not deterministically reproducible on a fast debug host, but the mechanism is confirmed from the CI log (pytest.fail at test.py:785, "Time limit of 180 seconds reached") and the retry_ok label.
b Root cause explained? Yes. The row-count check used a FIXED 180s wall-clock deadline. Consuming ~1M rows takes ~125s under TSan (8-13k rows/s); on a contended msan/tsan runner the 180s elapses while consumption is still steadily progressing, so the loop hits else: pytest.fail despite no stall.
c Fix matches root cause? Yes. Reset the no-progress deadline whenever the summed row count increases, so the test fails only on a genuine consumption stall — directly targets the "abandon a still-progressing run" mechanism.
d Test intent preserved? Yes. Still asserts all messages_num*threads_num*NUM_MV rows are consumed across the 5 MVs and still fails on a real stall (no progress for 180s). The final assert int(result) == ... is unchanged. No assertion weakened, no data reduced, no setting pinned.
e Demonstrated both directions? N/A for a deterministic local run (sanitizer-timing flake). Mechanism validated against the CI report; the fix is the same proven pattern already merged for the sibling RabbitMQ tests (check_expected_result_polling, #106200 / #107813) which took those tests from chronic-flaky to ~0.
f Fix general, not narrow? Yes. mv_combo was the LAST RabbitMQ streaming test still using a hand-rolled fixed deadline; every sibling already uses the no-progress-reset helper. This aligns it with the rest.
g Generalizes across inputs? N/A (test-robustness change, not a code bug).
h Backward compatible? N/A (test-only).
i Invariants/contracts preserved? N/A (test-only).

Session id: cron:clickhouse-worker-slot-1:20260709-123900

@groeneai

groeneai commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

cc @antaljanosbenjamin — could you review? Small test-robustness fix: makes test_rabbitmq_mv_combo reset its no-progress deadline on row-count progress instead of a fixed 180s wall-clock deadline, matching the polling helper already used by the other RabbitMQ streaming tests.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jul 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6edf3b2]

Summary: ✅


AI Review

Summary

This PR replaces the fixed 180-second wall-clock check in test_rabbitmq_mv_combo with the same no-progress timeout pattern already used by the other RabbitMQ streaming tests. I did not find a remaining correctness issue in the current diff or prior discussion.

Missing context / blind spots
  • ⚠️ The PR's RabbitMQ integration shards were still queued at review time, so I could not confirm the updated polling path under PR CI yet. A green run of the relevant Integration tests shards would close that gap.
Final Verdict
  • Status: ✅ Approve

@PedroTadim

Copy link
Copy Markdown
Member

@pamarcos maybe you can review this 😄

@pamarcos pamarcos self-assigned this Jul 9, 2026
@pamarcos

pamarcos commented Jul 9, 2026

Copy link
Copy Markdown
Member

Good, this is a similar approach of what we've taken lately witn rabbitmq and sanitized builds that expire.

@pamarcos
pamarcos added this pull request to the merge queue Jul 9, 2026
Merged via the queue into ClickHouse:master with commit 579786e Jul 9, 2026
343 of 344 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 9, 2026
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Jul 15, 2026
…ix-flaky-test_rabbitmq_mv_combo-progress"

This reverts commit 579786e, reversing
changes made to 797a5a9.
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Jul 15, 2026
…ening the timeout

Since ClickHouse#109170 fixed parallel_view_processing being ignored, MV fan-out is
serialized by default (setting defaults to false). This genuinely slowed
down `RabbitMQ`'s internal insert-to-views pipeline for the 5 materialized
views in this test, which had been relying on the previously-buggy
always-parallel behavior. ClickHouse#109892 masked the slowdown by making the test's
no-progress deadline reset on progress instead of addressing the throughput
regression, which is reverted here.

Set `parallel_view_processing = 1` in the test's default profile, which is
the only place this setting can be applied for RabbitMQ's internal insert
context (it can't be set via `CREATE TABLE ... SETTINGS` or session `SET`,
since `StorageRabbitMQ` captures the global context at construction).
Verified with the CI msan binary: 188s (serial, default) vs 119s (parallel)
for the underlying consumption; combined with the revert, the test now
passes in ~124s against the original fixed 180s deadline.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…-test_rabbitmq_mv_combo-progress

Fix flaky test_rabbitmq_mv_combo: keep polling while consumption progresses
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…ix-flaky-test_rabbitmq_mv_combo-progress"

This reverts commit 579786e, reversing
changes made to 797a5a9.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…ening the timeout

Since ClickHouse#109170 fixed parallel_view_processing being ignored, MV fan-out is
serialized by default (setting defaults to false). This genuinely slowed
down `RabbitMQ`'s internal insert-to-views pipeline for the 5 materialized
views in this test, which had been relying on the previously-buggy
always-parallel behavior. ClickHouse#109892 masked the slowdown by making the test's
no-progress deadline reset on progress instead of addressing the throughput
regression, which is reverted here.

Set `parallel_view_processing = 1` in the test's default profile, which is
the only place this setting can be applied for RabbitMQ's internal insert
context (it can't be set via `CREATE TABLE ... SETTINGS` or session `SET`,
since `StorageRabbitMQ` captures the global context at construction).
Verified with the CI msan binary: 188s (serial, default) vs 119s (parallel)
for the underlying consumption; combined with the revert, the test now
passes in ~124s against the original fixed 180s deadline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants