Repository navigation
Conversation
Failpoints are server-wide and persist across tests. A test that enables a REGULAR failpoint and then errors before reaching its `SYSTEM DISABLE FAILPOINT` leaks state into every test that follows. For example, when a test enables `smt_dont_merge_first_part` and fails mid-test, every subsequent test running OPTIMIZE will see its parts spuriously marked as "already assigned to some background operation" because `SharedMergeTreePartsCollector` unconditionally inserts `all_0_0_0` into the `already_processing_parts_on_this_replica` set when that failpoint is on. After each no-parallel/sequential test, query `system.fail_points` for enabled entries and disable them. Skipped for parallel tests because another in-flight test on the same server may legitimately be using a failpoint. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Workflow [PR], commit [726dbd7] Summary: ✅ AI ReviewSummaryThis PR adds failpoint cleanup between Findings
Final Verdict
|
| "log_comment": f'{args.testcase_basename}-{args.testcase_database}', | ||
| }, | ||
| ).decode().split() | ||
| except Exception as e: |
There was a problem hiding this comment.
_cleanup already tries to escalate connection failures from _cleanup_failpoints when the server is still alive, but this except Exception swallows those failures first, so that path is never reached.
Impact: a transient ConnectionError/ImproperConnectionState during failpoint enumeration is silently ignored, leaked failpoints stay enabled, and the next no-parallel test can still fail due to cross-test state contamination.
Please let connection-state exceptions propagate here (and keep the liveness check in _cleanup) so leaked failpoints are not silently ignored.
…lpoints count)
system.fail_points reflects process-global state, so the assertion
SELECT count() FROM system.fail_points WHERE enabled = 1; -- Expected: 0
is not a property of this test alone: any other test on the shared server
that leaves a failpoint enabled inflates the count. The test is no-parallel,
but that only prevents concurrent interference, not leftovers from the
parallel phase that runs before the sequential phase. Several parallel-phase
tests enable parallel_replicas_wait_for_unused_replicas (a REGULAR failpoint)
without disabling it (e.g. 04028_pr_move_global_in_to_prewhere,
03787_pr_group_by_read_mode_error, 04009_pr_aggr_in_order_coordination_mode,
04024_pr_read_in_order_through_join, 03810_pr_aggr_in_order_read_mode), so the
count was observed as 1/2/5 across CI runs (Fast test, 8 unrelated PRs in 30d).
Scope the count to the failpoints this test actually manipulates, which it
guarantees are disabled at that point. The reference stays 0 and the test
still verifies that its own failpoints start disabled, while no longer
depending on unrelated tests' global state.
Per review, the test now manipulates only failpoints used exclusively in
integration tests, so a public stateless run cannot leave any of them enabled
and thus cannot make this test fail before the failpoint under test fires:
- replicated_merge_tree_insert_retry_pause (only test_quorum_inserts)
- finish_set_quorum_failed_parts (PAUSEABLE_ONCE, only test_quorum_inserts)
- receive_timeout_on_table_status_response (ONCE, only
test_parallel_replicas_failover)
Every failpoint the test enables is explicitly disabled after use, so no
non-ONCE state leaks out of the test.
The test is named 03916_system_fault_injection_points to reflect that it tests
system.fail_points. The style check forbids the substring "fail" in stateless
test file names, so "fault injection points" (what failpoints are) is used
instead.
Regression coverage for ClickHouse#103403
(querying system.fail_points must not consume ONCE / PAUSEABLE_ONCE points).
Complementary to ClickHouse#105942, which resets failpoints after no-parallel tests but
deliberately skips the parallel phase where these leaks originate.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Dear @hanfei1991, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Failpoints are server-wide and persist across tests. A test that enables a REGULAR failpoint and then errors before reaching its
SYSTEM DISABLE FAILPOINTleaks state into every test that follows. For example, when a test enablessmt_dont_merge_first_partand fails mid-test, every subsequent test running OPTIMIZE will see its parts spuriously marked as "already assigned to some background operation" becauseSharedMergeTreePartsCollectorunconditionally insertsall_0_0_0into thealready_processing_parts_on_this_replicaset when that failpoint is on.After each no-parallel/sequential test, query
system.fail_pointsfor enabled entries and disable them. Skipped for parallel tests because failpoints cannot be used in parallel jobs.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...