Skip to content

Fix flaky test 03522_join_using_bug_78907 - #109514

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-flaky-03522-join-using-timeout
Jul 7, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-flaky-03522-join-using-timeout

Conversation

@groeneai

@groeneai groeneai commented Jul 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #78907

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

...

Description

03522_join_using_bug_78907 was flaky as a job-level Code: 159 TIMEOUT_EXCEEDED (return code 159), almost entirely on the amd_debug, flaky check job.

Root cause: the test's single query carried three timeout-related settings left over from the AST fuzzer that generated it (receive_timeout = 10., receive_data_timeout_ms = 10000, max_execution_time = 10.). The query itself returns only 3 rows and runs in ~0.2s in isolation, but under parallel debug / flaky-check load its wall-clock time occasionally crosses the self-imposed 10-second max_execution_time, and the query fails with TIMEOUT_EXCEEDED. The CI randomized-settings diagnosis confirms it is not a randomization issue ("All reruns passed. The failure is not reproducible").

Public CI evidence (play.clickhouse.com, 60d): 0 hits on master, ~15 hits concentrated on PR flaky-check runs, each at 12-21s aggregate over the ~50 flaky-check repeats. Example report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96130

Fix: remove the three timeout-only settings. They are unrelated to what the test verifies (analyzer JOIN USING top-level-identifier handling via analyzer_compatibility_join_using_top_level_identifier). All other settings are kept. The .reference output is byte-identical, so the test still catches the same class of bug; it just no longer trips its own 10s wall-clock cap under load.

Verified locally: 30/30 passes with randomization enabled; output identical to the reference before and after the change.

Version info

  • Merged into: 26.7.1.588 (included in 26.7 and later)
  • Backported to: 26.6.2.43

The test carried three timeout-related settings left over from AST fuzzing
(receive_timeout=10, receive_data_timeout_ms=10000, max_execution_time=10).
The query returns 3 rows in ~0.2s, but under parallel debug/flaky-check load
its wall-clock occasionally exceeds the self-imposed 10s cap, so it fails with
Code: 159 TIMEOUT_EXCEEDED. These settings are irrelevant to what the test
verifies (analyzer JOIN USING top-level-identifier handling); removing them
leaves the result byte-identical and eliminates the load-sensitive failure.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

groeneai commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. SELECT ... SETTINGS max_execution_time = 0.5 on a query that runs >0.5s throws Code: 159 TIMEOUT_EXCEEDED deterministically; the test's max_execution_time = 10. is the same cap, tripped by wall-clock under parallel debug load.
b Root cause explained? The query returns 3 rows (~0.2s isolated) but carries fuzzer-artifact timeout settings receive_timeout=10., receive_data_timeout_ms=10000, max_execution_time=10.. Under parallel flaky-check/debug load its wall-clock occasionally exceeds 10s, so it fails with TIMEOUT_EXCEEDED (return code 159). Not a randomization issue (CI diagnosis: reruns pass).
c Fix matches root cause? Yes. Removes exactly the three timeout-only settings that gate the failure; no assertion widening, no no-random-* tag, no data reduction.
d Test intent preserved / new tests added? Yes. The removed settings are unrelated to the analyzer JOIN USING top-level-identifier behavior the test verifies. All relevant settings kept; .reference byte-identical.
e Both directions demonstrated? Yes. Query trips the cap when max_execution_time is small and the query is slow; with the settings removed it passes 30/30 under randomization with identical output.
f Fix is general across code paths? N/A (flaky test setting fix, not a code bug).
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (flaky test setting fix, not a code bug).
h Backward compatible? (maintainer-approved exception only) N/A (flaky test setting fix, not a code bug).
i Invariants and contracts preserved? N/A (flaky test setting fix, not a code bug).

Session id: cron:clickhouse-worker-slot-9:20260706-150500

@groeneai

groeneai commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @vdimir — could you review this? Test-only change: it drops three timeout-related fuzzer-artifact settings (receive_timeout, receive_data_timeout_ms, max_execution_time=10) from 03522_join_using_bug_78907, which made the tiny 3-row query flakily hit Code: 159 TIMEOUT_EXCEEDED under parallel debug/flaky-check load. Reference output is unchanged.

@vdimir vdimir self-assigned this Jul 6, 2026
@vdimir vdimir added the can be tested Allows running workflows for external contributors label Jul 6, 2026
@vdimir
vdimir enabled auto-merge July 6, 2026 15:24
@clickhouse-gh

clickhouse-gh Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [cb7a036]

Summary: ✅


AI Review

Summary

This PR removes receive_timeout, receive_data_timeout_ms, and max_execution_time from tests/queries/0_stateless/03522_join_using_bug_78907.sql, while leaving the query shape, the analyzer_compatibility_join_using_top_level_identifier coverage, and the .reference output unchanged. Based on the linked issue, the test's edit history, and the current diff, I did not find a correctness or coverage regression: the dropped settings look like leftover fuzzer guardrails rather than part of the regression contract, so the change is a reasonable fix for the observed flaky TIMEOUT_EXCEEDED.

Missing context / blind spots
  • ⚠️ Full PR CI was still pending during review. I could only confirm that early checks such as Style check and Fast test had passed; the remaining build and later test shards had not finished yet.
Final Verdict

✅ No blocking issues found.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 6, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Updating the branch to fix the 04001_join_reorder_through_expression test, which was broken today in master.

@clickhouse-gh

clickhouse-gh Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.82% 85.83% +0.01%
Functions 91.47% 91.47% +0.00%
Branches 78.44% 78.47% +0.04%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 95 line(s), 1 function(s) across 39 file(s) · Details

Top files
  • src/Functions/FunctionsBitmap.h: 9 line(s)
  • src/DataTypes/DataTypeVariant.cpp: 6 line(s)
  • src/Storages/MutationCommands.cpp: 6 line(s)
  • src/Functions/array/range.cpp: 4 line(s)
  • src/Functions/h3CellAreaRads2.cpp: 4 line(s)

Full report

@alexey-milovidov
alexey-milovidov disabled auto-merge July 7, 2026 11:05
@alexey-milovidov
alexey-milovidov merged commit 490cf14 into ClickHouse:master Jul 7, 2026
173 of 174 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 7, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 7, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 7, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jul 7, 2026
Backport #109514 to 26.6: Fix flaky test 03522_join_using_bug_78907
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…in-using-timeout

Fix flaky test 03522_join_using_bug_78907
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v25.12-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants