{{ message }}
Fix test_disks_app_interactive ls helper to be robust to disks app sort order#106730
Merged
nikitamikhaylov merged 2 commits intoJun 9, 2026
Merged
Conversation
The recursive `disks list --recursive` output is sorted server-side by `std::sort` in `programs/disks/CommandList.cpp`, and the test asserts dict values against alphabetically ordered lists. If that sort algorithm ever changes (e.g. to an unstable sort that does not happen to produce alphabetical order on equal-key inputs, or to a different ordering), the exact-list assertions in `test_disks_app_interactive_list_directories_default` would fail. Sort listings on the Python side in the `ls` helper. The change is idempotent for the current alphabetical server-side sort, and decouples test assertions from the underlying sort algorithm. Verified locally with `python3 -m ci.praktika run "integration" --test "test_disks_app_interactive/test.py" --count 5` (25 passed in 11s). Related: ClickHouse#106650
Contributor
Author
Pre-PR validation gate
Session id: cron:clickhouse-ci-task-worker:20260608-145700 |
1 task
Contributor
Author
|
cc @azat — could you review this? It is a test-only fix per @ alexey-milovidov directive: makes the |
davenger
approved these changes
Jun 8, 2026
Contributor
|
Workflow [PR], commit [2924efe] Summary: ✅ AI ReviewSummary
Final Verdict
|
Under `Integration tests (amd_asan_ubsan, flaky)` praktika runs pytest-xdist with `--dist=each` and many workers concurrently. All workers share the runner host filesystem, so the test must scope every persistent path by `PYTEST_XDIST_WORKER`. The previous patch only sorted `ls` output on the client side; that addresses sort-order assertions but does nothing for concurrent workers stomping `/var/lib/clickhouse`, the shared `test/` directory, and the temporary `a.txt` next to `tests/integration/`. Changes: - `DisksClient.default_disk_root_directory` is now per-worker (`/var/lib/clickhouse-<gwN>`). - `getLocalDisksClient` wipes the per-worker root on every refresh, terminates any orphan `clickhouse disks` subprocess from the previous iteration, and writes a per-worker `config_<gwN>.xml` whose `<path>` points to that root. - `test_disks_app_interactive_list_directories_default` and `test_disks_app_interactive_test_move_and_write` now use per-worker directory and file names instead of the shared `test`/`a.txt`. - `test_disks_app_interactive_cp_and_read` uses per-worker file and directory names so concurrent workers cannot delete each other's `a.txt` mid-test. Verified locally with `python3 -m ci.praktika run "Integration tests (amd_asan_ubsan, flaky)" --test test_disks_app_interactive` at workers=4 and workers=8: 20/20 and 40/40 pass, vs. the previous 5/20 fail. Also verified single-worker mode (5/5 pass) and `--count 10 --workers 4` (50/50 pass). CI report on the previous flaky-check failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106730&sha=110670122e495cdcbc23b0fc7aba7a70679fa5c6&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20flaky%29 Related: ClickHouse#106650 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
Pre-PR validation gateFollow-up commit
Session id: cron:clickhouse-ci-task-worker:20260608-175200 |
Contributor
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 268 line(s), 34 function(s) across 113 file(s) · Details Top files
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Per @alexey-milovidov directive on #106650, harden integration tests that could wrongly assert results dependent on the sort algorithm.
What changes
tests/integration/test_disks_app_interactive/test.py— thelshelper inDisksClientnow sorts the parsed listings on the Python side. The disks app sorts entries withstd::sortinprograms/disks/CommandList.cppbefore printing, andtest_disks_app_interactive_list_directories_defaultasserts dict values against fixed alphabetically ordered lists. If the underlying sort changes (different algorithm, different ordering on equal-key inputs), the exact-list assertions would deterministically fail.The added Python-side
sortedis idempotent for the current alphabetical server-side sort. All existing expected lists are already alphabetical; no test assertions need to change.test_profile_max_sessions_for_userThe directive also mentioned
test_profile_max_sessions_for_user. Reviewed each assertion and found nothing order-dependent: the test relies onassert_logs_contain_with_retry(substring search),client.expect(...)(sequential prompt/string matching), andKILL QUERY(output discarded). No list comparisons. If a specific assertion is in scope, please point it out and I will follow up.Validation
Local run with the new
lshelper: 25 passed in 11sSimulated three server-side sort orderings (alphabetical, reverse, shuffle):
lspasseslspassesRelated: #106650
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.6.1.546