Skip to content

Fix test_peak_memory_usage flakiness by making logging of peak memory more accurate#93910

Merged
azat merged 1 commit intomasterfrom
abakharew/peak-memory-usage-value-issue
Jan 15, 2026
Merged

Fix test_peak_memory_usage flakiness by making logging of peak memory more accurate#93910
azat merged 1 commit intomasterfrom
abakharew/peak-memory-usage-value-issue

Conversation

@alexbakharew
Copy link
Copy Markdown
Contributor

@alexbakharew alexbakharew commented Jan 12, 2026

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Fixes: #90840

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jan 12, 2026

Workflow [PR], commit [48eb641]

Summary:

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 12, 2026

CLA assistant check
All committers have signed the CLA.

@alexbakharew alexbakharew force-pushed the abakharew/peak-memory-usage-value-issue branch from 307cc16 to 4e0e90f Compare January 14, 2026 15:37
@alexbakharew alexbakharew marked this pull request as ready for review January 14, 2026 16:53
@alexbakharew alexbakharew requested a review from azat January 14, 2026 17:03
@azat azat changed the title Attempt to fix flaky test test: fix test_peak_memory_usage flakiness Jan 14, 2026
@azat azat added the 🍃 green ci 🌿 Fixing flaky tests in CI label Jan 14, 2026
Copy link
Copy Markdown
Member

@azat azat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this is correct fix, but remove all unrelated changes, and I will look one more time

@alexbakharew alexbakharew requested a review from azat January 15, 2026 11:57
sendProfileInfo(state, executor.getProfileInfo());
sendProgress(state);
sendLogs(state);
/// Do it before sending end of stream, to have a chance to show log message in client.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is outdated, it should reflect why it is done here for SELECT

But what is more importantly, why we are doing it only for SELECT?

Let's do the following: do this for all queries, and rely on logging from dtor of query scope in case of exception, then we can remove this extra bool flag

And this should be enough for now.

Also note, that the still can be some drift actually (it is just a matter of do we have allocations between sending profile events this log)

So, if the test will be flaky after we can do the following:

  • make the comparsion less strict
  • use more complex query, so that allocations here will not update peak (since it will use more memory before)
  • remove the test

@azat azat force-pushed the abakharew/peak-memory-usage-value-issue branch 2 times, most recently from 925831d to f498ca4 Compare January 15, 2026 18:50
@azat azat force-pushed the abakharew/peak-memory-usage-value-issue branch from f498ca4 to 48eb641 Compare January 15, 2026 18:59
@alexbakharew alexbakharew self-assigned this Jan 15, 2026
@azat azat changed the title test: fix test_peak_memory_usage flakiness tests: fix test_peak_memory_usage flakiness Jan 15, 2026
@azat azat changed the title tests: fix test_peak_memory_usage flakiness Fix test_peak_memory_usage flakiness by making logging of peak memory more accurate Jan 15, 2026
@azat azat enabled auto-merge January 15, 2026 19:04
@azat azat added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit d7a4df7 Jan 15, 2026
132 checks passed
@azat azat deleted the abakharew/peak-memory-usage-value-issue branch January 15, 2026 22:41
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 15, 2026
alexbakharew added a commit that referenced this pull request Jan 28, 2026
…ry-usage-value-issue"

This reverts commit d7a4df7, reversing
changes made to 33b952e.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky test flaky test found by CI 🍃 green ci 🌿 Fixing flaky tests in CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: test_peak_memory_usage/test.py::test_clickhouse_client_max_peak_memory_usage_distributed

4 participants