Skip to content

Conversation

@arin-mirza
Copy link

@arin-mirza arin-mirza commented Nov 21, 2025

Why I'm doing:

The mem_pool property for resource groups was recently introduced.

There are currently no end-to-end SQL test cases for this functionality.

What I'm doing:

This pull request adds SQL tests, checking the correctness of the behavior under the following scenarios:

  • test_create_resource_group_with_mem_pool (should succeed)
  • test_create_two_resource_groups_with_mem_pool (should succeed)
  • test_create_two_resource_groups_with_mem_pool_then_try_alter (not allowed)
  • test_create_two_resource_groups_with_mem_pool_different_mem_limit (not allowed)

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Add SQL tests validating mem_pool on resource groups: creation, shared-pool constraints, and disallowed alterations.

  • SQL E2E tests for mem_pool in resource groups (test/sql/test_resource_group_mem_pool/...):
    • Creation succeeds: test_create_resource_group_with_mem_pool verifies mem_pool surfaced in show verbose resource groups.
    • Shared pool (same mem_limit): test_create_two_resource_groups_with_mem_pool ensures two groups can share the same mem_pool with matching mem_limit.
    • Alter restrictions:
      • test_create_resource_group_with_mem_pool_then_try_alter blocks changing mem_pool and mem_limit when mem_pool is set; allows updating max_cpu_cores.
      • test_create_two_resource_groups_with_mem_pool_then_try_alter blocks changing mem_pool for groups sharing a pool.
    • Constraint enforcement: test_create_two_resource_groups_with_mem_pool_different_mem_limit rejects creating a second group on the same mem_pool with a different mem_limit.
    • Both R/ (with expected results/regex) and T/ variants added for all scenarios.

Written by Cursor Bugbot for commit 6f8a6c8. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2025

CLA assistant check
All committers have signed the CLA.

@martinr0x
Copy link
Contributor

martinr0x commented Nov 21, 2025

@arin-mirza Please add backport to 4.0.

@alvin-celerdata alvin-celerdata changed the title Add SQL tests for mem_pool property of resource groups [UT] Add SQL tests for mem_pool property of resource groups Nov 22, 2025
@alvin-celerdata
Copy link
Contributor

@cursor review


show verbose resource groups all;
-- result:
[REGEX][^shared_resource_group_for_brad]
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect regex pattern for negative string match

The regex pattern [REGEX][^shared_resource_group_for_brad] incorrectly uses a negated character class, which matches any single character NOT in the set of characters from the string, rather than verifying the string itself is absent from the output. This causes the test to pass incorrectly regardless of whether shared_resource_group_for_brad exists. A negative lookahead like ^(?!.*shared_resource_group_for_brad).*$ would properly verify the resource group was not created.

Fix in Cursor Fix in Web

'mem_pool' = 'shared_pool_for_alex_and_brad'
);
-- result:
[REGEX]Property `mem_limit` must be equal for all resource groups using the mem_pool \[shared_pool_for_alex_and_brad\]
Copy link

Choose a reason for hiding this comment

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

Bug: Missing error format wrapper in expected result

The expected error result is missing the E: (error_code, '...') wrapper format. The pattern should be E: (1064, 'Property \mem_limit` must be equal...')` to match the actual error format returned by the system, consistent with other error assertions in the test suite. Without this wrapper, the test will fail to match the actual error output.

Fix in Cursor Fix in Web

@alvin-celerdata
Copy link
Contributor

@arin-mirza could you sign the CLA?

@alvin-celerdata
Copy link
Contributor

@mergify rebase

@mergify
Copy link
Contributor

mergify bot commented Nov 22, 2025

rebase

✅ Branch has been successfully rebased

@alvin-celerdata alvin-celerdata force-pushed the amirza/rg-memory-pool-e2e-sql-tests branch from c525342 to 6f8a6c8 Compare November 22, 2025 23:53
@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@murphyatwork murphyatwork enabled auto-merge (squash) November 25, 2025 10:41
@github-actions github-actions bot added the 4.0 label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants