Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: adjust a couple of memory monitoring tests #100550

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Apr 4, 2023

This commit adjusts a couple of memory monitoring related tests.

TestAggregatesMonitorMemory has been rewritten to observe the correct
memory monitor via crdb_internal.node_memory_monitors virtual table.

TestEvaluatedMemoryIsChecked is just straight up removed. Initially,
this test was expected to verify that builtin functions like repeat
perform memory accounting of the intermediate result via our memory
accounting system. However, that changed long time ago in 2b00f15
and now such builtins estimate their result size and return
errStringTooLarge error, so the test was no longer verifying what it
intended. This commit removes this test since we do verify the behavior
introduced in 2b00f15 elsewhere (in the
logic tests).

Fixes: #79014.
Fixes: #100119.

Release note: None

@yuzefovich yuzefovich added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Apr 4, 2023
@yuzefovich yuzefovich requested review from DrewKimball and a team April 4, 2023 03:15
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)


pkg/sql/builtin_mem_usage_test.go line 29 at r1 (raw file):

// record their memory usage as they build up their result.
func TestAggregatesMonitorMemory(t *testing.T) {
	defer leaktest.AfterTest(t)()

[nit] why not just skip with issue since this isn't testing anything right now?

This commit adjusts a couple of memory monitoring related tests.

`TestAggregatesMonitorMemory` has been rewritten to observe the correct
memory monitor via `crdb_internal.node_memory_monitors` virtual table.

`TestEvaluatedMemoryIsChecked` is just straight up removed. Initially,
this test was expected to verify that builtin functions like `repeat`
perform memory accounting of the intermediate result via our memory
accounting system. However, that changed long time ago in 2b00f15
and now such builtins estimate their result size and return
`errStringTooLarge` error, so the test was no longer verifying what it
intended. This commit removes this test since we do verify the behavior
introduced in 2b00f15 elsewhere (in the
logic tests).

Release note: None
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)


pkg/sql/builtin_mem_usage_test.go line 29 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

[nit] why not just skip with issue since this isn't testing anything right now?

I refactored the test to use crdb_internal.node_memory_monitors virtual table. PTAL.

Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 8 of 8 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 4, 2023

Build succeeded:

@craig craig bot merged commit 0d15e0d into cockroachdb:master Apr 4, 2023
@blathers-crl
Copy link

blathers-crl bot commented Apr 4, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 7d04684 to blathers/backport-release-23.1-100550: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: flake in TestEvaluatedMemoryIsChecked sql: make tests in builtin_mem_usage_test.go less flaky
3 participants