Repository navigation
Convert test 04630_merge_over_stale_packed_tmp_dir to an integration test - #114057
Conversation
…test Stateless tests must not modify table data on disk: the suite runs against arbitrary server configurations (object storage, shared merge tree, encrypted disks), where direct manipulation of part directories is either impossible or corrupts shared state. The scenario moves to `test_packed_io::test_merge_over_stale_packed_tmp_dir` unchanged: a merge must reclaim a stale `tmp_merge_` directory left by an interrupted attempt and must not seed any data from it. See #113978 (review) Related: #113978 Related: #111652 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [73f0f86] Summary: ✅ AI ReviewSummaryThis PR removes Final Verdict✅ No new findings. |
…ateless tests The check (`server_data_manipulation_in_stateless_tests`) flags stateless `.sh` tests that fetch a server-side filesystem path from a system table (`system.parts`, `system.detached_parts`, `system.projection_parts`, `system.tables`, `system.disks`, `system.server_settings` with `name = 'path'`) and also run file-modifying shell commands. With all offenders converted to integration tests in this PR, the exclusion list holds only one documented false positive and one test whose conversion is pending in #114057. Folds in #114056. Co-Authored-By: Claude Fable 5 <[email protected]>
…tegration Conflict: master pinned `storage_policy` to `default` in `04630_merge_over_stale_packed_tmp_dir.sh` (the local-disk workaround from #113978), while this branch removes the stateless test entirely. Resolved by keeping the deletion — the scenario now lives in the integration test `test_packed_io::test_merge_over_stale_packed_tmp_dir`, which controls the disk configuration directly, so the pin is no longer needed.
|
🕵 Merged The new test already passed in the previous run: Both stress failures on
|
…stale_packed_tmp_dir` The test copies a part directory with plain `cp`, which is only valid on a local disk. Pin the policy explicitly so the precondition is encoded in the test instead of relying on the module's implicit default `MergeTree` policy staying local.
|
🕵 Addressed the review (pinned Both stress failures on d4a0bc6 are unrelated to this test-only PR and reproduce fleet-wide:
|
|
🕵 Merged Both stress failures on 27e696f are the same known hang, unrelated to this PR:
|
|
🕵 Merged All three stress reds on
|
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 5 s compile time in total, 6 of them have a recent master baseline. |
|
🕵 Merged All three reds on
|
…to continue-pr-114057
…`05019` Two stateless tests that landed on `master` since the last merge are reported by `server_data_manipulation_in_stateless_tests`: - `04630_text_index_serialization_version_compatibility.sh` is a false positive: it runs `clickhouse-local` against its own `--path` under `CLICKHOUSE_TMP` and removes only that scratch directory. `clickhouse-local` is not the server, so the file-level gate now ignores the paths it reports, together with the rest of a query that continues on the following lines. Whatever precedes the invocation on the line is kept, so a real server-side fetch on the same line still counts. This also covers `03525_filesystem_caches_clickhouse_local.sh`, whose exclusion entry is dropped; the entry for `04630_merge_over_stale_packed_tmp_dir.sh` is dropped too because #114057 merged and deleted that test. - `05019_window_view_attach_wrapped_interval.sh` is a real violation: it rewrites the table metadata `.sql` with `sed -i`. Converted to `test_server_metadata_files/test.py::test_window_view_attach_wrapped_interval`, which edits the metadata through `helpers/database_disk.py` so it also works with a remote database disk, and additionally asserts that a full-definition `ATTACH` of the unsafe interval is still rejected. Regression probes added for the `clickhouse-local` rule (44 tests pass).
…gration tests Stateless tests must not modify the server's data on disk: the suite runs against arbitrary server configurations (object storage, shared merge tree, encrypted disks), where the local part layout either does not exist or does not mean what the test assumes, and modifying it corrupts shared state. 37 stateless tests move to integration tests, grouped by scenario: - test_broken_projections (extended): 02254, 04511 - test_broken_tmp_txn_version_startup (extended): 04104, 04492, 04493, 04507 - test_lost_part (extended): 02369, 02370, 04215 - test_corrupted_part_files (new): 02253, 02255, 02444, 04151, 04235, 04323, 04506 - test_mutations_with_tampered_parts (new): 04401, 04412, 04426, 04427, 04428, 04431 - test_attach_tampered_detached_parts (new): 04063, 04246, 04402, 04403, 04404, 04425 - test_backups_from_disk (new): 04054, 04495, 02864, 03001_restore..., 03214, 03231, replacing helpers/install_predefined_backup.sh; the canned backups move along - test_server_metadata_files (new): 03001_matview..., 04329, 04545 The conversions are faithful: every .reference output became an exact assertion, the explanatory comments are preserved, and DETACH/ATTACH stayed DETACH/ATTACH except where the original explicitly emulated a server restart (02255, 04215). Notable: 02444's `rm -f "$path/*.bin"` never expanded the glob (quoting bug), so its corruption was an accidental no-op; the converted test applies it for real and the assertions still hold. See ClickHouse#113978 (review) Related: ClickHouse#114056 Related: ClickHouse#114057 Co-Authored-By: Claude Fable 5 <[email protected]>
Related: #113978
Related: #111652
Test
04630_merge_over_stale_packed_tmp_dir(added in #111652) copies a packed part directory with plaincpto simulate a staletmp_merge_directory left by an interrupted merge. Modifying table data on disk is not allowed in stateless tests at all: the stateless suite runs against arbitrary server configurations (object storage, shared merge tree, encrypted disks), where direct filesystem manipulation is either meaningless or destructive — this test corrupted shared S3 blob reference counts in stress runs (#113978 (review)) before it was pinned to the local disk in #113978.This PR moves the scenario to the integration test
test_packed_io::test_merge_over_stale_packed_tmp_dir, where the cluster environment is fully controlled and the part directory can be copied safely inside the container. The test logic and all assertions are unchanged: the merge must reclaim the leftovertmp_merge_all_1_2_1directory (verified via theRemoving stale temporary directorylog message and the directory being gone), must not seed any data from it into the new part, and the resulting packed part must passCHECK TABLE. Verified locally: the new integration test passes.A style check preventing new stateless tests from modifying the server's data directory is added separately in #114056.
Changelog category (leave one):
Version info
26.8.1.1486(included in26.8and later)