Skip to content

Enable Kafka integration tests on arm64 - #103248

Merged
alexey-milovidov merged 6 commits into
masterfrom
kafka-tests-arm64
Apr 25, 2026
Merged

alexey-milovidov merged 6 commits into
masterfrom
kafka-tests-arm64

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

The tests/integration/test_storage_kafka suite was previously pytest.mark.skip-ed on ARM because confluentinc/cp-kafka:5.2.0, confluentinc/cp-schema-registry:5.2.0 and zookeeper:3.4.9 are all x86_64-only images and could not even start on an arm64 host.

Bump the images used in docker_compose_kafka.yml to multi-arch variants (confluentinc/cp-kafka:7.9.0,
confluentinc/cp-schema-registry:7.9.0, zookeeper:3.8) when the current host is arm64, and remove the unconditional skip.

On amd64 the defaults keep the exact image tags that were used before, so the tests that pass today should not be affected.

Starting from zookeeper:3.5 the clientPort is no longer defaulted to 2181, it has to be provided via the ;<port> suffix in ZOO_SERVERS, so the server list is also overridden on arm64.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Enable Kafka integration tests on arm64.

Version info

  • Merged into: 26.5.1.76

The `tests/integration/test_storage_kafka` suite was previously
`pytest.mark.skip`-ed on ARM because `confluentinc/cp-kafka:5.2.0`,
`confluentinc/cp-schema-registry:5.2.0` and `zookeeper:3.4.9` are all
x86_64-only images and could not even start on an arm64 host.

Bump the images used in `docker_compose_kafka.yml` to multi-arch
variants (`confluentinc/cp-kafka:7.9.0`,
`confluentinc/cp-schema-registry:7.9.0`, `zookeeper:3.8`) when the
current host is arm64, and remove the unconditional skip.

On amd64 the defaults keep the exact image tags that were used before,
so the tests that pass today should not be affected.

Starting from `zookeeper:3.5` the `clientPort` is no longer defaulted to
`2181`, it has to be provided via the `;<port>` suffix in `ZOO_SERVERS`,
so the server list is also overridden on arm64.
@clickhouse-gh

clickhouse-gh Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [875de9d]

Summary: ✅


AI Review

Summary

This PR enables Kafka integration tests on arm64 by switching the Kafka/ZooKeeper/Schema Registry images to arm64-compatible tags on ARM hosts, removing the ARM skip in Kafka integration helpers, and making small test-tag/robustness adjustments in stateless tests. I did not find new correctness, safety, performance, or compatibility issues that require changes.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Apr 21, 2026
alexey-milovidov and others added 3 commits April 21, 2026 12:36
Under LLVM coverage instrumentation, a handful of stateless tests
consistently time out (server is slow enough that `SYSTEM FLUSH LOGS`
hits the 180 s limit, or client-side curl/socket timeouts trip).
Tag them with `no-llvm-coverage` so they are skipped in that check.

Tests affected:
- `02818_memory_profiler_sample_min_max_allocation_size`
- `02992_all_columns_should_have_comment`
- `02293_http_header_full_summary_without_progress`
- `03150_trace_log_add_build_id`
- `04078_native_protocol_input_validation`

CI report: #103248 (comment)
PR: #103248
The test used to fully parse the server's response to each query, trying
to walk every packet (Progress, ProfileInfo, Data, ProfileEvents, …)
until EndOfStream. That parsing was fragile:

* the revision guards for extra `Progress` fields were wrong (written
  rows/bytes are gated by `DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO`
  = 54420, not 54372; the one varuint read under "CLIENT_REVISION >=
  54448" does not correspond to anything the server actually sends at
  revision 54449), and
* `skip_block` assumed a fixed 8 bytes per value for any column type it
  did not recognise, including `DateTime` (4 bytes) that is used in
  the `ProfileEvents` block.

Either miscount silently misaligned the stream, and a later
`read_string` would then try to UTF-8-decode a stray byte (seen in CI
as ``'utf-8' codec can't decode byte 0x88 in position 0``). Whether
this hit depended on which packets the server interleaved in a given
run, so the test was flaking under the flaky check.

All three validations under test — stage, query_kind, compression —
are performed while parsing the `Query` packet inside
`TCPHandler::receiveQuery`, so a rejection is always the first packet
after `Hello`. Looking at only the first packet is therefore enough to
distinguish "server accepted the query" from "server rejected it", and
avoids reimplementing the rest of the wire format. Rewrite
`get_response` accordingly and drop the now-unused `skip_block` helper
and packet-type constants.

Verified locally by running the test 200 times sequentially and in
5-way parallel batches against a local server — all runs pass.

CI reports for the original failures:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103248&sha=36decd61da30dfb987385b90fb346ce6b07731d0&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103248&sha=36decd61da30dfb987385b90fb346ce6b07731d0&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Comment thread tests/integration/helpers/cluster.py Resolved
The previous implementation iterated over the string "arm, aarch"
character-by-character, checking each single character against
platform.processor().lower(). That never matched real arch names like
"aarch64", so is_arm() was effectively dead on arm64 hosts.

Switch to platform.machine() which reliably returns "arm64" on macOS
Apple Silicon and "aarch64" on Linux arm64.

Addresses review: #103248 (comment)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Apr 25, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Apr 25, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Excellent!

Merged via the queue into master with commit 0528b8e Apr 25, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the kafka-tests-arm64 branch April 25, 2026 12:41
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 25, 2026
pull Bot pushed a commit to sonvt1710/ClickHouse that referenced this pull request Apr 25, 2026
The previous implementation iterated over the string "arm, aarch"
character-by-character, checking each single character against
platform.processor().lower(). That never matched real arch names like
"aarch64", so is_arm() was effectively dead on arm64 hosts.

Switch to platform.machine() which reliably returns "arm64" on macOS
Apple Silicon and "aarch64" on Linux arm64.

Addresses review: ClickHouse#103248 (comment)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@PedroTadim

Copy link
Copy Markdown
Member

Backporting to fix CI

@robot-ch-test-poll2 robot-ch-test-poll2 added pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR labels Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-build Pull request with build/testing/packaging improvement pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.4-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants