Files
datastore/tests/config/users.d/coverage_fault_injection_seeds.xml
Alexey MilovidovandClaude Opus 4.8 0e87a4ad05 Pin coverage fault-injection seeds server-side to fix readonly tests
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]>
2026-06-20 20:57:21 +00:00

25 lines
1.3 KiB
XML

<clickhouse>
<profiles>
<default>
<!--
Pin the seeds of random-by-default fault injection mechanisms so the set
of branches exercised inside the server is stable run-to-run under LLVM
coverage (without this the coverage report flickers on files reachable
from these injection points).
These are set in the `default` profile (server side) rather than injected
as per-query client/URL settings on purpose: as per-query settings they
were re-applied on every statement, so a statement issued after switching
to readonly mode (e.g. `SET profile = 'readonly'` / `SET readonly = 1`)
failed with "Cannot modify '...' setting in readonly mode". As session
defaults they are not re-applied per statement, so tests that exercise
readonly mode (01187_set_profile_as_setting, 00543_..., etc.) are
unaffected. Installed only for coverage runs by install.sh, gated on
its llvm-coverage flag.
-->
<backup_restore_keeper_fault_injection_seed>1</backup_restore_keeper_fault_injection_seed>
<insert_keeper_fault_injection_seed>1</insert_keeper_fault_injection_seed>
</default>
</profiles>
</clickhouse>