Repository navigation
Fix flaky test_kafka_formats_with_broken_message integration test - #108252
alexey-milovidov merged 1 commit into
Conversation
…V flush)
The error row in kafka_errors_*_mv can lag behind the data rows on slow
sanitizer/coverage builds. query_with_retry returns its last result even when
the check_callback never passed, so on a too-short budget it returns an empty
string and json.loads("") raised an opaque JSONDecodeError (Expecting value:
line 1 column 1). Over 60 days every json.loads-mode failure was on a slow
build (asan_ubsan/tsan/msan/llvm_coverage), zero on fast/release builds.
Double the error-MV poll budget (30s -> 60s) for slow-build headroom and assert
the result is non-empty before json.loads so any residual failure surfaces with
a clear message instead of an opaque JSON decode error.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-3:20260623-024200 |
|
cc @antaljanosbenjamin — could you review this? It stabilizes the flaky |
|
Workflow [PR], commit [b0f0a79] Summary: ✅ AI ReviewSummaryThis PR updates the Kafka integration test Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 363 line(s), 29 function(s) across 122 file(s) · Details Top files
|
alexey-milovidov
left a comment
There was a problem hiding this comment.
Let's give it a chance.
Cherry pick #108252 to 26.6: Fix flaky test_kafka_formats_with_broken_message integration test
…ssage integration test
Backport #108252 to 26.6: Fix flaky test_kafka_formats_with_broken_message integration test
…essage-errors-flush-retry Fix flaky test_kafka_formats_with_broken_message integration test
|
Backporting further to fix CI |
…_message 26.3's per-format error check predates the retry wrapper master already had around it, so #108252's diff (retry_count 30->60, empty-result guard) doesn't apply textually. Brought in master's retry + guard directly with #108252's fix folded in; the resolved block is byte-identical to master's current text. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ssage integration test
Backport #108252 to 26.3: Fix flaky test_kafka_formats_with_broken_message integration test
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Stabilizes the flaky integration test
test_storage_kafka/test_batch_slow_0.py::test_kafka_formats_with_broken_message.Root cause. The error row written into
kafka_errors_<format>_mvcan lagbehind the data rows on slow builds. The test polls for it with
query_with_retry(retry_count=30, sleep_time=1, check_callback=lambda res: len(res) > 0),but
query_with_retryreturns its last result even whencheck_callbackneverpassed (
if result is not None: return result). So when the error MV has notflushed within the 30s budget, the call returns an empty string and
json.loads("")raises the opaqueJSONDecodeError: Expecting value: line 1 column 1 (char 0)at line 405.Slow-build only. Over the last 60 days, every
json.loads-mode failure ofthis test was on a slow build:
amd_asan_ubsan(x10),amd_tsan(x1),amd_msan(x1),amd_llvm_coverage(x1). Zero on fast/release builds. 30 days:~15 hits across 11 distinct PRs plus 2 on master, all
amd_asan_ubsan. This isthe classic "30s wait calibrated for fast builds" timing race; the same class was
fixed for sibling Kafka tests in #100286 and #105138.
Fix. Double the error-MV poll budget (30s -> 60s) to give slow builds headroom,
and assert the polled result is non-empty before
json.loadsso any genuineresidual failure surfaces with a clear message instead of an opaque JSON decode
error. Test-only change; the test's assertions on
raw_message/errorareunchanged.
CI report (latest, PR #108182, commit 17b519a):
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108182&sha=17b519a0248e&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%202%2F6%29
Version info
26.7.1.144(included in26.7and later)26.6.2.11,26.3.33.65