Skip to content

Make stress tests more stressful - #106385

Closed
PedroTadim wants to merge 38 commits into
masterfrom
stress-stress
Closed

PedroTadim wants to merge 38 commits into
masterfrom
stress-stress

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

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

  • Add restarter threads for ClickHouse, MinIO, Azurite, and Kafka. Sometimes do a graceful shutdown, others a kill. Write intentional kills into a file, so that later it can track if a real OOM happened or not.
  • Kill random mutations.
  • Use random probabilities for the Thread Fuzzer in each run.

@clickhouse-gh

clickhouse-gh Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1883a58]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 1/2) FAIL
04001_join_reorder_through_expression FAIL cidb
Stateless tests (amd_debug, parallel) FAIL
04001_join_reorder_through_expression FAIL cidb
Stateless tests (amd_tsan, parallel, 1/2) FAIL
04001_join_reorder_through_expression FAIL cidb
Stateless tests (amd_msan, WasmEdge, parallel, 1/2) FAIL
04001_join_reorder_through_expression FAIL cidb
Stateless tests (amd_tsan, s3 storage, parallel, 1/2) FAIL
04001_join_reorder_through_expression FAIL cidb
Stateless tests (arm_binary, parallel) FAIL
04001_join_reorder_through_expression FAIL cidb
Stress test (amd_tsan) FAIL
Test script failed FAIL cidb
Possible deadlock on shutdown (see gdb.log) FAIL cidb

AI Review

Summary

This PR makes the stress harness inject much harsher chaos: mid-run clickhouse-server restarts, MinIO/Redpanda restarts, random mutation kills, and per-run Thread Fuzzer randomization. The recent fixes around intentional signal 9 accounting, MinIO restart handling, and main-server PID selection address several earlier review points, but the current branch still changes the stress-test contract in ways that make failures non-actionable: the ordinary stateless suite is still not restart-safe, mutation cancellation is still injected into tests that depend on their own mutations completing, and the latest restart timeout increase still exceeds the runner-side liveness window that decides whether the server "died".

Findings
  • ⚠️ [ci/jobs/scripts/stress/stress.py:1263], [tests/clickhouse-test:4723] RandomServerRestarter is now enabled for the ordinary 0_stateless run, but _RESTART_MARKER_FILE is still only consulted by liveness checks. There is still no retry/expected-interruption path for tests whose own transient state disappears when the restart lands between setup and assertion, even though 0_stateless still contains 1189 tests matching ENGINE = Memory|Set|Join alone. That means the harness can now turn its own injected restart into ordinary UNKNOWN_TABLE/empty-result/diff failures rather than surfacing a server bug. [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/106385#discussion_r3355419022]
  • ⚠️ [ci/jobs/scripts/stress/stress.py:684] RandomQueryKiller still kills arbitrary in-flight mutations from the global queue, while the same 0_stateless suite still has 350 tests that issue ALTER ... UPDATE|DELETE|MATERIALIZE ... SETTINGS mutations_sync=2, poll system.mutations, or exercise KILL MUTATION semantics directly. There is still no opt-in or retry boundary around those test-owned mutations, so the harness can manufacture failures by cancelling the very fixture a test is waiting for. [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/106385#discussion_r3355419027]
  • ⚠️ [ci/jobs/scripts/stress/stress.py:1245], [tests/clickhouse-test:4729] The latest timeout increase gives RandomServerRestarter a 600s start budget on slow builds, but the restart-aware liveness side still only bumps to 30 probes. With the current backoff that is about 265s of sleep time, or about 565s even if every probe consumes its full 10s timeout; the restart can also spend up to 90s in the preceding graceful-stop path before the 600s budget even starts. A legitimate slow sanitizer restart can therefore still trip SERVER_DIED before the restarter's own timeout has expired. [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/106385#discussion_r3355047554]
Final Verdict

Changes requested. The remaining problems are in the stress harness contract itself, not in style or CI noise: the branch still lets its own injected restarts and mutation kills masquerade as ordinary product failures, and the current restart timeout no longer matches the runner's restart-tolerant liveness window.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 3, 2026
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/stress_job.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

This PR changes only CI and stress-test harness code: it rewrites the stress-test chaos threads (server/MinIO/Redpanda restart logic), randomizes thread-fuzzer probabilities, and reworks OOM detection, plus documentation and tooling updates. None of this touches the server's query-execution path, so it cannot plausibly speed up ClickBench Q4, Q15, or Q32. The measured improvements (-16%, -11%, -5%) are run-to-run variance, and none are large enough to override that judgment. All three flagged improvements are downgraded to not-sure.

clickbench

⚠️ 3 inconclusive

Flagged queries (3 of 43)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
⚠️ 4 not_sure 261 219 -16.1% <0.0001 CI/stress-harness-only PR; ClickBench query execution path untouched, so the -16% is run-to-run variance
⚠️ 15 not_sure 236 210 -11.0% <0.0001 Off-path: PR only changes stress-test chaos threads/fuzzer config. -11% unrelated to this PR despite trending history
⚠️ 32 not_sure 1423 1350 -5.1% <0.0001 CI-only diff cannot move server query latency; -5% is noise, not a PR effect

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: b3f42197-750f-4b01-b678-e02c5b5278cb
  • MIRAI run: 6cc18b5c-725d-4fed-be5b-e5608bb3408e
  • PR check IDs:
    • clickbench_117455_1781027027
    • clickbench_117475_1781027027
    • clickbench_117481_1781027027
    • tpch_adapted_1_official_117487_1781027027
    • tpch_adapted_1_official_117498_1781027027
    • tpch_adapted_1_official_117555_1781027027

PedroTadim and others added 2 commits July 6, 2026 08:50
# Conflicts:
#	ci/jobs/scripts/stress/stress.py
#	ci/jobs/stress_job.py
The randomized Thread Fuzzer sleep injection was exported at the top of
`stress_runner.sh`, so it was active for every `start_server`, including the
setup-phase startups that only allow the default ~70s budget. When the
per-run randomization rolled an aggressive combination (`SLEEP_PROBABILITY`
up to 0.1 and `SLEEP_TIME_US_MAX` up to 500000us), the injected sleeps slowed
startup on sanitizer builds past that budget and the setup startup reported a
false `Cannot start clickhouse-server` (the server came up moments later).

Move the export into a `setup_thread_fuzzer` function and call it only right
before the server that runs the actual stress workload (`start_server 10`,
which already has a larger startup budget). The setup-phase server starts now
run without the fuzzer, mirroring the existing `unset "${!THREAD_@}"` before
the post-stress restart. The now-redundant `SYSTEM STOP THREAD FUZZER` after
the setup startup is removed.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106385&sha=latest&name_0=PR&name_1=Stress+test+%28amd_asan_ubsan%29
PR: #106385

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread ci/jobs/stress_job.py Resolved
Comment thread tests/clickhouse-test Resolved
Comment thread ci/jobs/scripts/stress/stress.py Resolved
Comment thread tests/docker_scripts/stress_tests.lib Resolved
@PedroTadim

Copy link
Copy Markdown
Member Author

Server restarts are slow. This is not worth it to run in the CI.

@PedroTadim PedroTadim closed this Aug 4, 2026
@PedroTadim
PedroTadim deleted the stress-stress branch August 7, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant