Skip to content

Remove low-value integration tests (stricter selection) - #123165

Merged
alexey-milovidov merged 1 commit into
masterfrom
remove-low-value-integration-tests-2
Oct 2, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
remove-low-value-integration-tests-2

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

This is a stricter version of #122485, which was reverted in #122679.

The number of integration tests keeps growing without control. An integration test costs an order of magnitude more than a functional test: in CI resources, in amount of code, and in the effort to read, debug and maintain it. Many recently added integration tests fall into these categories:

  • tests of the integration test harness;
  • tests of server misconfigurations, that is, error handling for a broken config;
  • tests of corner cases in obscure functionality, contrived states or hand-corrupted data;
  • reproductions of internal races rebuilt with failpoints, probabilistic stress loops, and timing assertions;
  • tests that only check that a metric, log line or setting exists.

This PR removes 85 such test files, plus config files and a helper that only these tests used.

Compared to the previous attempt, the following are kept, following the review feedback:

  • all data lake tests: Iceberg, Delta Lake, Paimon, Hive, the catalog e2e tests and their helpers, and Spark-related tests, including test_storage_delta_shuffles and the Iceberg inverted-bounds compatibility tests;
  • the test_system_stop.py tests of the streaming engines (Kafka, NATS, RabbitMQ, S3Queue);
  • test_refreshable_mv_no_multi_read, because Apache ZooKeeper does not have MULTI_READ, so this is a real deployment;
  • test_storage_s3_queue/test_file_iterator_lost_lock.py (S3Queue exactly-once processing), test_parallel_replicas_alias_columns, test_concurrent_hash_join_single_join_memory_limit, test_storage_s3/test_parquet_prewhere.py, the /play Web UI tests, and the skipped test_storage_rabbitmq/test_shutdown.py.

The durations table in ci/jobs/scripts/integration_tests_configs.py is left unchanged to avoid merge conflicts with the private repository. Entries for files that no longer exist are not used.

This PR also adds guidelines against these kinds of integration tests to .claude/CLAUDE.md, and states there that interoperability tests with data lakes, catalogs and Spark are valuable.

Estimated savings: the removed files take about 2.8% of the integration test time, about 3,000 USD of CI cost per week out of about 107,000 USD for integration tests. This uses per-test durations from CIDB for the week starting 2026-09-21 and AWS on-demand prices.

Removed tests

The time is the average sum of test durations per run of Integration tests (arm_binary, distributed plan) on master. It is higher under sanitizers.

Test s/run Why removed
test_keeper_http_jemalloc/test.py 244.6 Starts a 3-node Keeper ensemble only to check HTTP status codes and content types of the /jemalloc debug web UI pages. These are debug pages, and the check needs neither a Keeper ensemble nor an integration test.
test_unknown_config_option/test.py 159.7 Server misconfiguration: about 45 separate clusters, each starting a server with a mistyped or odd config to check whether UNKNOWN_ELEMENT_IN_CONFIG is raised.
test_storage_kafka/test_keeper_session_loss_direct_read.py 123.4 Corner case in obscure functionality: a direct SELECT from an inactive Kafka2 table after Keeper session loss returns ABORTED. Waits up to 600 s for the table to become inactive in order to check one error code.
test_executable_udf_async_metrics/test.py 118 8 server restarts and 128 MiB ballast processes to check that executable UDF memory and process gauges move.
test_keeper_container_nodes/test_disabled.py 82.2 A dedicated cluster for one assertion: with the feature flag disabled, creating a container node fails.
test_keeper_ttl_nodes/test_disabled.py 81.7 A dedicated cluster for one assertion: with the feature flag disabled, creating a TTL node fails.
test_http_handlers_config_error/test.py 77.9 Server misconfiguration: 12 cases that start or reload the server with a broken http_handlers config and check which error is reported.
test_refreshable_mv_watch_fault/test.py 72.2 Internal race reproduced with a Keeper failpoint, followed by a 60 s sleepEachRow refresh, to check that RefreshTask re-registers its watch.
test_rmv_access_denied_on_rename_race/test.py 66.8 Probabilistic 60 s loop of SYSTEM REFRESH on one default server, hunting for a race. A green run proves nothing.
test_storage_kafka/test_poll_timeout_after_assignment.py 65.6 Wall-clock timing assertion on an internal Kafka poll-timeout fallback.
test_phantom_parts_in_mutations/test.py 56.9 Probabilistic stress test (concurrent inserts, mutations and part corruption with sleeps) that may or may not hit the race it targets. A green run proves nothing.
test_http_connection_socket_buffer_settings/test.py 48.1 Checks that settings appear in system.server_settings, that out-of-range values are logged on reload, and parses ss output for the kernel socket buffer size.
test_intersect_or_except_kill_query/test.py 45.9 Re-arms failpoints to check that KILL QUERY is noticed in the middle of an IntersectOrExceptTransform chunk, which pins an implementation detail of the cancellation loop.
test_statistics_non_physical_upgrade/test.py 45.8 Upgrade path for an invalid STATISTICS declaration on a non-physical column, which only 26.4 accepted, with 7 ALTER variants on that state.
test_storage_nats/test_nats_jetstream_credentials_rotation.py 38.4 Corner case: a custom TCP proxy that rejects authentication is put in front of NATS to check JetStream reconnection after the client library gives up. Already flaky in CI.
test_executable_udf_profile_events/test.py 33.5 17 cases asserting the values of profile events (CPU, memory, bytes) for executable UDFs.
test_named_collections_encrypted2/test_integr.py 32.1 Generic s3/s3Cluster/url/backup/S3Queue scenarios with named collections, where the encrypted Keeper storage is incidental to what is checked. The core encrypted-named-collections coverage remains in test_named_collections_encrypted2/test.py.
test_keeper_commit_readahead_no_reset/test.py 31.3 Asserts the ratio of an internal Keeper read-ahead fallback counter during log replay, which is a performance-tuning detail.
test_ddl_worker_stale_task_name/test.py 31.2 Internal race reproduced by deleting a ZooKeeper node during DDLWorker reinitialization, and checks that a debug-assertion log line is absent.
test_database_catalog_shutdown_system_logs/test.py 25.7 Three failpoints inject exceptions into user database shutdown to check the internal shutdown order of system logs, a path that is reachable only with failure injection.
test_storage_s3_queue/test_dimensional_metrics.py 23.3 Checks that S3Queue dimensional metrics exist and have values.
test_replicated_database_active_node_taken/test.py 23.3 Misconfiguration: CREATE DATABASE ... ON CLUSTER with literal shard and replica names so that two hosts share a replica, then checks the error code.
test_zero_copy_drop_table_with_leftover/test.py 21.9 Hand-planted untracked part directory with zero-copy replication, which is not recommended for production.
test_zookeeper_send_window_broken_promise/test.py 21.5 Failpoints throw inside the internal request window of the ZooKeeper client sendThread, a path that is reachable only with failure injection.
test_nullable_tuple_subcolumns/test.py 20.6 Runs about 10 existing stateless tests again with a profile setting on and off, against copied reference files. This duplicates the stateless tests.
test_memory_tracker_large_allocation_trace/test.py 19.2 Checks the format of a warning log message and the shape of its stack trace.
test_rocksdb_backup_restore/test.py 18.7 Exotic configuration: backup and restore of EmbeddedRocksDB tables with read_only and a shared rocksdb_dir, in 8 variants.
test_zero_copy_invalidated_system_columns/test.py 18.5 Inspects Keeper node contents for zero-copy replication internals, a feature that is not recommended for production.
test_executable_pool_udf_profile_events/test.py 18.4 14 cases asserting that each profile event for executable_pool UDFs is non-zero.
test_projection_unavailable_replicated_db/test.py 18.2 Contrived configuration: two Replicated database replicas with different enable_positional_arguments_for_projections.
test_constraint_subquery_legacy_metadata/test.py 18.2 Hand-edited legacy metadata of constraints with scalar subqueries, dictGet or joinGet.
test_projection_unavailable_at_startup/test.py 17.6 Contrived state: a projection with positional arguments that cannot be analyzed at startup.
test_wasm_udf_fail_close/test.py 17.2 Server misconfiguration: an unknown webassembly_udf_engine value is rejected at startup.
test_user_query_log_config_validation/test.py 17 Server misconfiguration: the server refuses to start when query_log.table is user_query_log.
test_keeper_bench_zookeeper/test.py 15.7 Tests the keeper-bench developer tool against Apache ZooKeeper, not the server.
test_jemalloc_profiler_sampling_rate/test.py 14.7 Restarts the server 3 times to check that a config value shows up as an asynchronous metric.
test_broken_detached_part_quarantine/test.py 14.3 Hand-torn part copied into detached/, followed by replica drop and restore, to exercise an extremely rare error path.
test_parallel_replicas_skip_inactive_replicas_all_groups/test.py 14.1 Corner case of cluster name resolution (all_groups.<db>) for parallel replicas coordinator sizing, checked by a log line. The main case remains in test_parallel_replicas_skip_inactive_replicas.
test_concurrent_part_removal_threshold_for_remote_disk/test.py 13.8 Checks which debug log line ("serially" or "concurrently") is printed depending on a setting.
test_parallel_table_shutdown/test.py 13.4 Proves that tables shut down in parallel by parsing a timing log line under a sleep failpoint.
test_create_dictionary_in_startup_script/test.py 12.8 Contrived case: a startup script that drops and creates a dictionary inside the system database.
test_totime_legacy_replicated_delete/test.py 12.5 Extremely narrow combination: a standalone DELETE in a Replicated database with legacy toTime inside a SQL UDF, under the oldest DDL entry format.
test_parallel_replicas_insert_select_coordinator_reuse/test.py 12.2 A failpoint drops a replica from the liveness snapshot, and the test checks a log line. Reachable only with failure injection.
test_keeper_memory_soft_limit_ratio/test.py 12.1 Sends SIGHUP to Keeper and checks that a log line with the setting value changes.
test_system_zookeeper_watches/test.py 11.7 Checks that system.zookeeper_watches shows a new session id after SYSTEM RECONNECT ZOOKEEPER.
test_jemalloc_merge_tree_arenas/test.py 10.7 Checks that a setting is read and that a jemalloc arena metric exists.
test_parallel_replicas_local_replica_forced_inactive/test.py 10.4 A failpoint forces the initiator's own liveness to false, a state that is reachable only with failure injection.
test_parallel_replicas_cluster_shadows_replicated_db/test.py 10.3 Corner case: a configured cluster with the same name as a Replicated database, checked by a coordinator log line.
test_replicated_database_system_clusters_log_level/test.py 10 Checks the log level of a message.
test_role/test_replicated_ddl_current_roles.py 9.8 Narrow regression found by fuzzing: CREATE TABLE ... AS SELECT FROM system.current_roles executed by the Replicated database DDL worker.
test_cache_s3_object_truncation/test.py 9.4 Overwrites a data object in MinIO with a truncated prefix behind the server's back, which is external storage corruption.
test_storage_log_damaged_array/test.py 9.1 Hand-truncated array streams in Log/TinyLog files on disk.
test_keeper_sanitizer_logs/test.py 9.1 Tests the integration test harness: Keeper stderr.log collection and detection of sanitizer markers at cluster.shutdown.
test_keeper_slow_connection_log/test.py 9 Sleeps 5 s on a Keeper connection and checks that a log line is absent.
test_insert_deduplication_version_guard/test.py 8.1 Server misconfiguration: the server refuses to start with a legacy insert_deduplication_version value.
test_database_hdfs_url_allowlist/test.py 7.2 Contrived configuration sequence: an HDFS database pointing to a non-existent host, then remote_url_allow_hosts is tightened and the server restarted.
test_limit_by_transform_kill_query/test.py 6.5 Failpoints pause LimitByTransform to check where an internal cancellation check is placed.
test_filesystem_cache_eviction_metrics/test.py 5.9 Checks that filesystem cache metrics exist and advance after evictions.
test_point_in_polygon_cache_size/test.py 5.7 Checks that a cache size setting is re-read on config reload and that a SYSTEM DROP command empties the cache.
test_sql_security_analyzer_setting/test.py 5.3 Contrived configuration: a definer profile tries to disable the obsolete analyzer setting.
test_keeper_nuraft_streaming/test.py 5.2 Checks only that new settings appear in the output of the conf command and in a log line.
test_kafka_bad_messages/test_delete_topic_helper.py 5 Tests a Python helper of the test harness with a stub admin client. It does not start the server.
test_drop_data/test.py 5 Duplicates 02932_query_settings_max_size_drop* and test_reload_max_table_size_to_drop.
test_insert_query_profile_events/test.py 4.6 Checks that InsertQuery/AsyncInsertQuery counters increase.
test_index_uncompressed_cache_zero_size/test.py 4.5 Checks that cache profile events are zero when the cache size is zero.
test_compatibility_readonly_constrained_setting/test.py 4.4 Duplicates a stateless test added in the same PR.
test_naive_bayes_xml_dictionary/test.py 4.3 Misconfiguration: error messages for malformed NAIVE_BAYES XML dictionary definitions.
test_aggregating_in_order_transform_kill_query/test.py 4.3 A failpoint pauses AggregatingInOrderTransform and the test counts a LOG_TEST marker to check where an internal cancellation check is placed.
test_mutation_analyzer_setting/test.py 4.2 Contrived configuration: a server profile sets the obsolete allow_experimental_analyzer = 0.
test_memory_thread_stacks_metric/test.py 4.1 Checks that MemoryThreadStacks* asynchronous metrics are populated.
test_hypothetical_projection_estimate_writes_nothing/test.py 4.1 Checks that EXPLAIN WHATIF does not delete a hand-planted temporary projection directory inside a part.
test_kafka_bad_messages/test_admin_client_helper.py 4 Tests a Python helper of the test harness with stubs. It does not start the server or Kafka.
test_user_query_log_distributed_backend/test.py 3.9 Misconfiguration: query_log with the Distributed engine makes system.user_query_log throw.
test_system_users_predicate_pushdown/test.py 3.9 Contrived configuration: the same user name defined in two users_xml storages.
test_native_incorrect_data_deserialization/test.py 3.8 Hand-crafted Native bytes with an inconsistent Variant, read with clickhouse-local. A narrow regression for one malformed input, and it does not need an integration test.
test_cluster_waiters/test_lost_network_interface.py 3.8 Tests the integration test harness (helpers/cluster.py) with stubs. It does not start the server.
test_keeper_watch_profile_events/test.py 3.6 Checks that KeeperWatchTriggered* profile events increase.
test_executable_udf_driver_config_reload/test.py 3.5 Checks that an experimental flag is re-read on SYSTEM RELOAD CONFIG.
test_keeper_request_total_with_subrequests/test.py 3.1 Checks that a Keeper counter increases.
test_core_dump_size_limit/test.py 3 Checks that the core dump rlimit changes after SYSTEM RELOAD CONFIG.
test_thread_pool_queue_size/test.py 2.9 Absurd configuration: queue_size = UINT64_MAX. Already covered by a unit test from the same PR.
test_async_metrics_overload_warning/test.py 2.7 Checks that a warning row is present in system.warnings after startup.
test_cluster_waiters/test_rabbitmq_start_retry.py 0.7 Tests the integration test harness (wait_rabbitmq_to_start) with stubs. It does not start the server.
test_prometheus_protocols/test_promqltest_loader.py 0.2 Tests the test suite's own promqltest_loader.py parser. It does not start the server.
test_cluster_waiters/test_exec_in_container_detach.py 0.2 Tests the integration test harness (exec_in_container) with stubs. It does not start the server.

Changelog category (leave one):

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

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/123165]

Version info

  • Merged into: 26.10.1.1263-master (included in 26.10 and later)

This is a stricter version of #122485,
which was reverted in #122679.

Remove 85 integration test files. They test the integration test harness,
server misconfigurations, corner cases in obscure functionality, contrived or
hand-corrupted states, internal races rebuilt with failpoints, or only assert
that a metric, log line or setting exists.

Unlike the previous attempt, keep the tests related to data lakes (Iceberg,
Delta Lake, Paimon, Hive, catalogs and their helpers, Spark), the
`test_system_stop.py` tests of streaming engines, and a few other tests of real
user-facing behavior.

The durations table in `ci/jobs/scripts/integration_tests_configs.py` is left
unchanged to avoid merge conflicts; entries for files that no longer exist are
ignored.

Also add guidelines against low-value integration tests to `.claude/CLAUDE.md`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4cbdcbc]

Summary: ✅


AI Review

Summary

This PR removes 85 integration tests plus their helper/config files and adds guidance for avoiding expensive low-signal integration coverage. The cleanup direction makes sense in general, but a few of the deleted tests are not harness trivia or generic misconfiguration checks: they are the only regression coverage I could find for supported upgrade and migration contracts. Because those contracts are easy to break while refactoring validation and metadata loading, I would keep or replace those tests before merging.

Findings
  • ⚠️ Major — tests/integration/test_statistics_non_physical_upgrade/test.py:6: this is the only coverage I found for opening 26.4-created metadata that contains STATISTICS on non-physical columns and for Replicated database recovery replaying that stored definition from Keeper. The remaining tests cover fresh DDL / fresh MATERIALIZE STATISTICS, not grandfathered metadata after upgrade, so deleting this turns a supported-upgrade contract into untested behavior.
  • ⚠️ Major — tests/integration/test_constraint_subquery_legacy_metadata/test.py:1: the remaining qualification tests validate new CREATE-time normalization, but this file is the only one I found that restarts or attaches hand-edited legacy metadata with unqualified names inside CONSTRAINT, view, dictGet, and joinGet expressions. Deleting it drops backward-compatibility coverage for loading metadata written by older versions.
  • ⚠️ Major — tests/integration/test_insert_deduplication_version_guard/test.py:30: tests/integration/test_migration_deduplication_hash/test.py keeps the happy-path rolling upgrade covered, but this deleted file is the only regression coverage I found for the fail-close guard around insert_deduplication_version: reject legacy values at startup, reject them on SYSTEM RELOAD CONFIG, and keep the live config unchanged. That guard is part of the documented migration contract in src/Core/ServerSettings.cpp, so treating it as a generic misconfiguration test weakens a real safety invariant.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: restore these three upgrade/migration tests, or replace each with narrower coverage that still exercises the same old-metadata / fail-close contracts.

LLVM Coverage Report

Measured on commit 4cbdcbc.

Metric Baseline Current Δ
Lines 88.30% 88.10% -0.20%
Functions 91.80% 91.80% +0.00%
Branches 79.70% 79.50% -0.20%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +145 lines in 47 files (-2067 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 1, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 1, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 2, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 2, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Very much LGTM, indeed.

Merged via the queue into master with commit 1edfa49 Oct 2, 2026
149 checks passed
@alexey-milovidov
alexey-milovidov deleted the remove-low-value-integration-tests-2 branch October 2, 2026 06:39
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-testing Test content only (no production code). 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