Repository navigation
Fix flaky test 04027_system_start_replicated_view - #107254
Merged
nikitamikhaylov merged 1 commit intoJun 12, 2026
Merged
nikitamikhaylov merged 1 commit into
nikitamikhaylov merged 1 commit into
Conversation
The "<4: new rows>" assertion waits for the resumed refreshable view to complete at least one more refresh after SYSTEM START REPLICATED VIEW. That wait was only 30 iterations of 0.5s (15s), while both the initial-refresh wait and the stop wait earlier in the test use 60 iterations (30s). After resume, with REFRESH AFTER 1 SECOND the next refresh is scheduled in the past and fires immediately, but the BackgroundSchedulePool wake plus the Keeper round-trips to actually run the refresh and APPEND a row take at least as long as the initial refresh did, plus an extra coordination watch round-trip. Under load (seen on arm_asan_ubsan, azure, parallel) that can exceed 15s, so the loop gives up before the row is appended and the test reports "<4: new rows> 0". The engine behavior is correct (the view leaves Disabled, "<3: restarted> 1" always passes) and a rerun succeeds. Extend the restart wait to 120 iterations (60s) so the budget covers resume detection plus a full refresh run and is no shorter than the initial-refresh wait. The assertions and reference output are unchanged. Reproduced deterministically by making the refresh body sleep ~18s: the old 15s loop reports "<4: new rows> 0" while a 60s loop reports 1. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Collaborator
Author
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-10:20260611-163600 |
Collaborator
Author
|
cc @al13n321 — could you review this? It only extends the post-resume wait in 04027_system_start_replicated_view from 15s to 60s (matching the test's own initial-refresh wait), because under arm_asan_ubsan/azure load the resumed refresh can take longer than 15s to append a row and the loop gave up too early ( |
Contributor
|
Workflow [PR], commit [065e2f4] Summary: ✅ AI ReviewSummary
Final Verdict
|
Contributor
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 349 line(s), 56 function(s) across 99 file(s) · Details Top files
|
nikitamikhaylov
approved these changes
Jun 12, 2026
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes flaky
04027_system_start_replicated_view, seen onStateless tests (arm_asan_ubsan, azure, parallel)(0 master hits; self-heals on rerun).The
<4: new rows>assertion waits for the resumed refreshable view to complete at least one more refresh afterSYSTEM START REPLICATED VIEW. That wait was 30 iterations of 0.5s (15s), while both the initial-refresh wait and the stop wait earlier in the same test use 60 iterations (30s).After resume, with
REFRESH AFTER 1 SECONDthe next refresh is scheduled in the past and fires immediately, but theBackgroundSchedulePoolwake plus the Keeper round-trips to run the refresh andAPPENDa row take at least as long as the initial refresh, plus an extra coordination watch round-trip. Under load this can exceed 15s, so the loop gives up before the row is appended and the test reports<4: new rows> 0. The engine behavior is correct: the view leavesDisabled(<3: restarted> 1always passes) and a rerun succeeds.This extends the restart wait to 120 iterations (60s) so the budget covers resume detection plus a full refresh run and is no shorter than the initial-refresh wait. Assertions and reference output are unchanged.
Reproduced deterministically by making the refresh body sleep ~18s: the old 15s loop reports
<4: new rows> 0, a 60s loop reports1. With the fix, 50/50 runs pass with randomization enabled.Version info
26.6.1.697