Skip to content

Fix is_arm() to actually detect ARM hosts - #103516

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-is-arm-detection
Apr 25, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-is-arm-detection

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

The is_arm helper in tests/integration/helpers/cluster.py was:

return any(arch in platform.processor().lower() for arch in ("arm, aarch"))

("arm, aarch") is a single string, not a tuple, so the generator iterates character-by-character ('a', 'r', 'm', ',', ', ...) and checks each single character against platform.processor().lower(). It never matches real arch names like aarch64, and on many Linux hosts platform.processor() is empty anyway, so is_arm effectively always returned a meaningless value.

Replace with platform.machine().lower() in ("arm64", "aarch64"), which reliably returns aarch64 on Linux arm64 and arm64 on macOS Apple Silicon.

Spotted by clickhouse-gh[bot] while reviewing #103248:
#103248 (comment)

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):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

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]>
@clickhouse-gh

clickhouse-gh Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e7a1b14]

Summary: ✅


AI Review

Summary

This PR fixes is_arm in integration test helpers by replacing a broken character-wise check based on platform.processor with a direct architecture check using platform.machine. The change is small, targeted, and correct for ClickHouse CI environments, with no correctness or safety concerns identified.

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

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good.

@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
Merged via the queue into master with commit 8c040c9 Apr 25, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-is-arm-detection 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
alexey-milovidov added a commit that referenced this pull request Apr 25, 2026
The arm64 integration runs on PR #103519
(#103519) confirmed that
these test modules fail with `no matching manifest for linux/arm64/v8`
or `linux/amd64 does not match the detected host platform` because
their docker images are not published for arm64:

- `test_kerberos_auth/test.py` — `kerberos_kdc`
- `test_storage_kerberized_kafka/test.py` — `kafka_kerberos`
- `test_mysql57_database_engine/test.py` — `mysql:5.7`
- `test_ytsaurus/test_dictionaries.py` — `ytsaurus_backend`
- `test_ytsaurus/test_tables.py` — `ytsaurus_backend`

Reintroduce a properly-working module-level skip using the now-fixed
`is_arm` helper (#103516). Other tests touched by this PR pass on arm64
or are still being stabilised by the broader Kafka-on-arm work, so they
remain unskipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants