Repository navigation
ci: switch all tests to azurite-rs - #102354
Conversation
Sometimes real azure can give 503 errors [1], plus it is not possible to run tests locally. [1]: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98776&sha=e98e65358583dbe10ac317de0aa9aca927d58213&name_0=PR&name_1=Stateless%20tests%20%28arm_asan%2C%20azure%2C%20parallel%29
Resolve conflicts: - Keep `sequential-test-runs` addition from master in `functional_tests.py` - Remove azure connection string fetching (PR intent: switch to local azurite-rs) - Keep `persistent_removal_log` addition from master in `azure_storage_conf.xml` Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Workflow [PR], commit [bba0a99] Summary: ✅ AI ReviewSummaryThis PR switches CI Azure-backed tests to local ClickHouse Rules
Final VerdictStatus: ✅ Approve |
The config now hardcodes `BlobEndpoint=http://127.0.0.1:10000/...`, but `stress_runner.sh` never started `azurite-rs` (unlike `functional_tests` and `upgrade_runner.sh`). This means stress runs that randomly pick Azure storage would fail connecting to a non-existent local emulator. Add `start_azurite` CLI command to `clickhouse_proc.py` and call it from `stress_runner.sh` right after `start_minio`. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
alesapin
left a comment
There was a problem hiding this comment.
What's the point of replacing tests with real system which runs in production with some random wibe-coded binary which nobody every read? What is the goal of tests and CI than? It's better to remove tests with Azure than waste compute in this way.
wibe -> vibe
than -> then Azurite-rs is a mock-implementation of Azure, similar to Azurite. It implements just enough of the API to pass all the tests for Azurite and all the tests for ClickHouse, so it is suitable for isolated, reliable testing. Vibe-coding allows creating these implementations quickly, with high quality and conformance. The only thing you can't expect is the completeness of the implementation, so if you start using a new part of the API, it might not be supported. As with any mocks, it has advantages and disadvantages. We can still run tests with the real Microsoft Azure, but it should be outside of the test contour with a tight feedback loop. The tests with real Microsoft Azure can run periodically in the background, or only in the master. We shouldn't allow them to run in every pull request, because Microsoft Azure is unreliable. |
|
@alexey-milovidov let's have them in master and private repo? BTW, it was the way how these tests were intended to work, I'm surprised that we run them in each PR (it should be quite expensive). Likely it was enabled by accident. So proposal is to remove this tests run from PR workflow. |
|
Thanks, this will be good! |
Reduce the large insert from 5M to 500K rows. The 5M row insert produced ~50MB of data causing broken pipe errors in azurite-rs in-memory emulator. 500K rows is still sufficient to verify filesystem cache on write behavior. Also fix `start_azurite`: remove accidental tuple wrapping of the command string, and add a readiness check (like `start_minio` has) to ensure azurite-rs is ready before proceeding. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The previous azurite-rs version had axum's default 2 MiB body size limit, causing HTTP 413 for PutBlock/PutBlob requests exceeding 2 MiB. This broke test `02241_filesystem_cache_on_write_operations` which inserts 5M rows into Azure storage. The new version disables the body size limit. ClickHouse/azurite-rs@603706f Also revert the test row count reduction from the previous commit since the root cause is now fixed in azurite-rs itself. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
|
||
| if [[ "$EXPORT_S3_STORAGE_POLICIES" == "1" ]]; then | ||
| if [[ "$NO_AZURE" != "1" ]] && [[ -n "$AZURE_CONNECTION_STRING" ]]; then | ||
| if [[ "$NO_AZURE" != "1" ]]; then |
There was a problem hiding this comment.
install.sh now always links azure_storage_conf.xml whenever EXPORT_S3_STORAGE_POLICIES=1, even when no explicit Azure test mode is requested.
That makes Azure endpoint availability part of startup for paths like upgrade_runner.sh. In that path, azurite-rs is started directly in background without any readiness check, so this change introduces a race: server startup can hit Azure access checks before emulator is ready, causing intermittent failures.
Please either:
- add a readiness check in
upgrade_runner.sh(or switch it toclickhouse_proc.py start_azurite), or - keep Azure config opt-in for non-Azure test modes.
The request-level logging in azurite-rs v0.1.0-603706f used `eprintln!` which performs synchronous blocking writes to stderr, bypassing `--silent` mode. Under heavy concurrent load, all tokio worker threads contend on stderr's internal lock, preventing the server from accepting new connections — manifesting as 408 connect timeouts in ClickHouse's Azure client. The fix replaces `eprintln!` with `tracing::info!` which respects the `--silent` flag and does not block the async runtime. ClickHouse/azurite-rs@2571a1f Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…s check `upgrade_runner.sh` started `azurite-rs` in background without waiting for the blob endpoint to accept connections. When the server started and performed the Azure storage access check, the emulator could still be initializing, causing intermittent startup failures. Switch to the same helper used by `stress_runner.sh` (`clickhouse_proc.py start_azurite`), which probes `http://127.0.0.1:10000/` with retries before returning, matching the pattern used elsewhere in the CI scripts. Addresses review feedback on PR #102354. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`Stateless tests (arm_asan_ubsan, azure, parallel)` was failing with 51 timed-out tests on PR #102354. The `azurite.log` artifact showed: accept error: Too many open files (os error 24) repeating throughout the run. Under parallel load, each test query opens a TCP connection plus an in-memory blob handle, which exhausts the default soft `nofile` limit (1024) inherited from the `stateless-test` Docker container. Bump the soft limit to `1048576` before exec'ing `azurite-rs`, with a fallback to `ulimit -Hn` in case the requested value exceeds the container's hard limit. Since `start_azurite` is also invoked from `stress_runner.sh` and `upgrade_runner.sh`, this fix covers all paths that start the emulator. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102354&sha=60f99abba77121fb721425d290fd4c5a5a8fe521&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20azure%2C%20parallel%29 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Per reviewer feedback, `functional_tests_jobs_azure` should only run in master and the private repo, not in every pull request. Running them per-PR was expensive and exposed the feedback loop to Microsoft Azure outages, which we already hit on PR #98776. The jobs remain in `ci/workflows/master.py` so the master branch still exercises the Azure storage integration. Addresses review feedback on PR #102354.
The "Check Workflows" job failed because `.github/workflows/pull_request.yml` was out of date relative to `ci/workflows/pull_request.py`. This regenerates the YAML to reflect the removal of the per-PR Azure stateless test jobs. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102354&sha=8f44304af63c6085c44d94ad6fd8e0415b5eb559&name_0=PR&name_1=Config%20Workflow Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Source change in ci/workflows/pull_request.py removed the per-PR azure functional tests, but the generated workflow YAML was not regenerated.
|
Please, disregard what @alesapin said - it was an exaggeration. Do not remove Azure tests from PRs. Restore them. |
Reverts the per-review change that removed `functional_tests_jobs_azure` from `ci/workflows/pull_request.py`. Per maintainer feedback on #102354 (comment), the earlier review comment was an exaggeration and Azure tests should keep running per PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This reverts commits 65fe336 and d4d4de0 which removed `functional_tests_jobs_azure` from `ci/workflows/pull_request.py` and regenerated `.github/workflows/pull_request.yml` accordingly. Per follow-up review feedback, the per-PR Azure jobs should remain enabled — now that all tests run against `azurite-rs` (a local mock), the previous concerns about Microsoft Azure flakiness and per-PR cost no longer apply. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…-to-azurite-rs # Conflicts: # ci/jobs/functional_tests.py # programs/keeper-bench/Runner.cpp # src/Disks/DiskObjectStorage/DiskObjectStorage.cpp
…s' into ci/switch-all-tests-to-azurite-rs
The previous attempt to switch tests to azurite-rs (PR #102354) was reverted after stateless and stress tests failed under arm_asan_ubsan and azure-stress matrices due to the in-memory emulator's unbounded memory growth. ClickHouse merge-tree workloads constantly overwrite parts and drop containers, but azurite-rs was leaving every old extent behind on overwrite, never freeing staged-but-uncommitted blocks, and not reclaiming any data on container deletion. This release adds reference-counted extents, frees orphaned data on every overwrite path, and cascades extent deletes through container deletion. Stress run: 50 overwrites of a 4 MiB blob now grow RSS by ~11 MiB instead of ~200 MiB. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

Sometimes real azure can give 503 errors 1, plus it is not possible to run tests locally.
Also, we had an incident with Azure yesterday.
Changelog category (leave one):
Version info
26.5.1.170