Repository navigation
Pin coverage fault-injection seeds server-side to fix readonly tests - #108046
Merged
Merged
Conversation
Under LLVM coverage, `clickhouse-test` pinned `insert_keeper_fault_injection_seed` and `backup_restore_keeper_fault_injection_seed` to make the set of branches exercised inside the server stable run-to-run. It did so by injecting them as per-query settings via `CLICKHOUSE_CLIENT_OPT` / `CLICKHOUSE_URL_PARAMS`. Because the client re-applies these settings on every statement, a statement issued after the session switched to readonly mode failed with `Cannot modify '...' setting in readonly mode. (READONLY)`. This broke tests that exercise readonly mode, e.g. `01187_set_profile_as_setting` (`set profile='readonly'; select ...`) and `00543_access_to_temporary_table_in_readonly_mode` (`SET readonly = 1; CREATE TEMPORARY TABLE ...`), where the follow-up statement got the seed-modification error instead of the expected behaviour. Only the per-test coverage job hit this because the seed injection is gated on `--llvm-coverage`. Pin the seeds server-side instead, in the `default` profile via `tests/config/users.d/coverage_fault_injection_seeds.xml`, installed only for coverage runs by `install.sh` (new `--llvm-coverage` flag, passed from `functional_tests.py`). As session defaults the seeds are not re-applied per statement, so switching to readonly mode does not try to modify them, while coverage stays deterministic. A test that explicitly sets these settings still overrides the profile default. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=d7da366c9b182d6e05a64f422ae563298995c55e&name_0=NightlyCoverage&name_1=Stateless%20tests%20%28amd_llvm_coverage_per_test%2C%20per_test_coverage%2C%205%2F8%29 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [3a5a46b] Summary: ✅ AI ReviewSummaryThis PR moves LLVM coverage fault-injection seed pinning from per-query Final VerdictStatus: ✅ Approve |
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.
Under LLVM coverage,
clickhouse-testpinsinsert_keeper_fault_injection_seedandbackup_restore_keeper_fault_injection_seedso the set of branches exercised inside the server is stable run-to-run. It did so by injecting them as per-query settings viaCLICKHOUSE_CLIENT_OPT/CLICKHOUSE_URL_PARAMS.Because the client re-applies these settings on every statement, a statement issued after the session switched to readonly mode failed with
Cannot modify '...' setting in readonly mode. (READONLY). This broke tests that exercise readonly mode, e.g.:01187_set_profile_as_setting—set profile='readonly'; select ...00543_access_to_temporary_table_in_readonly_mode—SET readonly = 1; CREATE TEMPORARY TABLE ...The follow-up statement got the seed-modification error instead of the expected behaviour. Only the per-test coverage job hit this because the seed injection is gated on
--llvm-coverage.This pins the seeds server-side instead, in the
defaultprofile viatests/config/users.d/coverage_fault_injection_seeds.xml, installed only for coverage runs byinstall.sh(new--llvm-coverageflag, passed fromfunctional_tests.py). As session defaults the seeds are not re-applied per statement, so switching to readonly mode does not try to modify them, while coverage stays deterministic. A test that explicitly sets these settings still overrides the profile default.Verified locally against a running server that, when the seeds are session defaults (not per-query settings),
SET profile='readonly'neither errors nor resets them, matching the expected behaviour of the affected tests.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=d7da366c9b182d6e05a64f422ae563298995c55e&name_0=NightlyCoverage&name_1=Stateless%20tests%20%28amd_llvm_coverage_per_test%2C%20per_test_coverage%2C%205%2F8%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Version info
26.6.1.1090