Skip to content

branch-4.0: [fix](test) Make test_analyze_long_string Case 5 stable against sample rows randomness #64408 - #64506

Merged
morningman merged 1 commit into
branch-4.0from
auto-pick-64408-branch-4.0
Jun 30, 2026
Merged

branch-4.0: [fix](test) Make test_analyze_long_string Case 5 stable against sample rows randomness #64408#64506
morningman merged 1 commit into
branch-4.0from
auto-pick-64408-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #64408

…e rows randomness (#64408)
## Problem
`test_analyze_long_string` Case 5 (and potentially Case 3) can flake
because
after inserting data, the BE may not have reported the row count to FE
yet.
When `OlapAnalysisTask.doExecute()` runs with `info.rowCount == 0` and
`tableSample != null`, it returns early without executing any SQL — the
column finishes with `FINISHED` state but an empty message, so the
expected
skip reason from the `assert_true` long-string guard is never produced:
```
expected skip reason visible for col big_str, got msg=
==> expected: <true> but was: <false>
```
The audit log confirms that no sampling SQL was issued for `big_str` in
the failing run — the task was short-circuited entirely.
## Fix
1. **Suite.groovy**: Add `waitRowCountReady(db, table,
expectedRowCount)`
that polls `SHOW DATA FROM db.table` via `sql_return_maparray` until
the BE-reported row count reaches the expected value.
2. **test_analyze_long_string.groovy**: Call `waitRowCountReady` after
inserts for both sample analyze cases:
- Case 3 (sample percent 100)
- Case 5 (sample rows 3, DUJ1 template)
3. Case 5 data uses `repeat('z', 2048)` for all rows — a secondary
defense
against sample randomness missing the long row even when row count is
properly reported.
Co-authored-by: Claude <noreply@anthropic.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

@morningmanmorningman reopened this Jun 30, 2026
@morningman
morningman merged commit 12f15af into branch-4.0Jun 30, 2026
40 of 44 checks passed
@github-actions
github-actionsBot deleted the auto-pick-64408-branch-4.0 branch June 30, 2026 10:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hello-stephen@morningman@yujun777