Skip to content

Pin coverage fault-injection seeds server-side to fix readonly tests - #108046

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-01187-readonly-keeper-seed
Jun 21, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-01187-readonly-keeper-seed

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Under LLVM coverage, clickhouse-test pins insert_keeper_fault_injection_seed and backup_restore_keeper_fault_injection_seed so the set of branches exercised inside the server is 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 ...
  • 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 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.

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):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Version info

  • Merged into: 26.6.1.1090

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]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3a5a46b]

Summary: ✅


AI Review

Summary

This PR moves LLVM coverage fault-injection seed pinning from per-query clickhouse-test client/URL settings into a coverage-only server-side default profile config installed by tests/config/install.sh --llvm-coverage, with the functional test job passing that flag for coverage runs. I did not find correctness or CI-safety issues in the changed code.

Final Verdict

Status: ✅ Approve

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov
alexey-milovidov merged commit fa90072 into master Jun 21, 2026
165 of 166 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-01187-readonly-keeper-seed branch June 21, 2026 23:32
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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