-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[UT] Add SQL tests for mem_pool property of resource groups #65859
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| -- name: test_create_resource_group_with_mem_pool | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_test_user; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_test_user | ||
| to (user='test_user') | ||
| with ( | ||
| 'cpu_weight' = '12', | ||
| 'mem_limit' = '20%', | ||
| 'mem_pool' = 'test_pool_1' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_test_user.+12.+20(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=test_user\)\s*(test_pool_1) | ||
| -- !result | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_test_user; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| -- name: test_create_resource_group_with_mem_pool_then_try_alter | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_james; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_james | ||
| to (user='james') | ||
| with ( | ||
| 'cpu_weight' = '9', | ||
| 'mem_limit' = '66%', | ||
| 'max_cpu_cores' = "8", | ||
| 'mem_pool' = 'mem_pool_for_james' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_james.+9.+66(\.\d+)?%.+8.+NORMAL.+\(id=\d+,.+user=james\)\s*(mem_pool_for_james) | ||
| -- !result | ||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
| -- result: | ||
| E: (1064, 'Property `mem_pool` cannot be altered [mem_pool_for_james].') | ||
| -- !result | ||
|
|
||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'mem_limit' = '99%' | ||
| ); | ||
| -- result: | ||
| E: (1064, 'Property `mem_limit` cannot be altered for resource groups with mem_pool [mem_pool_for_james].') | ||
| -- !result | ||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'max_cpu_cores' = "1" | ||
| ); | ||
| -- result: | ||
| -- !result | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_james.+9.+66(\.\d+)?%.+1.+NORMAL.+\(id=\d+,.+user=james\)\s*(mem_pool_for_james) | ||
| -- !result | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_james; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_john; | ||
| [UC] drop resource group shared_resource_group_for_jane; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_john | ||
| to (user='john') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_john_and_jane' | ||
| ); | ||
|
|
||
|
|
||
| [UC] create resource group shared_resource_group_for_jane | ||
| to (user='jane') | ||
| with ( | ||
| 'cpu_weight' = '8', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_john_and_jane' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_john.+7.+55(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=john\)\s*shared_pool_john_and_jane | ||
| -- !result | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_jane.+8.+55(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=jane\)\s*shared_pool_john_and_jane | ||
| -- !result | ||
|
|
||
|
|
||
| [UC] drop resource group shared_resource_group_for_john; | ||
| [UC] drop resource group shared_resource_group_for_jane; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool_different_mem_limit | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_alex; | ||
| [UC] drop resource group shared_resource_group_for_brad; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_alex | ||
| to (user='alex') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_for_alex_and_brad' | ||
| ); | ||
|
|
||
| create resource group shared_resource_group_for_brad | ||
| to (user='brad') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '88%', | ||
| '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\] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Missing error format wrapper in expected resultThe expected error result is missing the |
||
| -- !result | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_alex.+7.+55(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=alex\)\s*(shared_pool_for_alex_and_brad) | ||
| -- !result | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX][^shared_resource_group_for_brad] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect regex pattern for negative string matchThe regex pattern
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @arin-mirza need to fix or resolve this comment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should be |
||
| -- !result | ||
|
|
||
|
|
||
| [UC] drop resource group shared_resource_group_for_alex; | ||
| [UC] drop resource group shared_resource_group_for_brad; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool_then_try_alter | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_skywalker; | ||
| [UC] drop resource group shared_resource_group_for_vader; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_skywalker | ||
| to (user='skywalker') | ||
| with ( | ||
| 'cpu_weight' = '2', | ||
| 'mem_limit' = '70%', | ||
| 'mem_pool' = 'shared_pool_skywalker_and_vader' | ||
| ); | ||
|
|
||
|
|
||
| [UC] create resource group shared_resource_group_for_vader | ||
| to (user='vader') | ||
| with ( | ||
| 'cpu_weight' = '2', | ||
| 'mem_limit' = '70%', | ||
| 'mem_pool' = 'shared_pool_skywalker_and_vader' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_skywalker.+2.+70(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=skywalker\)\s*shared_pool_skywalker_and_vader | ||
| -- !result | ||
|
|
||
| show verbose resource groups all; | ||
| -- result: | ||
| [REGEX]shared_resource_group_for_vader.+2.+70(\.\d+)?%.+NORMAL.+\(id=\d+,.+user=vader\)\s*shared_pool_skywalker_and_vader | ||
| -- !result | ||
|
|
||
| alter resource group shared_resource_group_for_vader with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
| -- result: | ||
| E: (1064, 'Property `mem_pool` cannot be altered [shared_pool_skywalker_and_vader].') | ||
| -- !result | ||
|
|
||
| alter resource group shared_resource_group_for_skywalker with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
| -- result: | ||
| E: (1064, 'Property `mem_pool` cannot be altered [shared_pool_skywalker_and_vader].') | ||
| -- !result | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_skywalker; | ||
| [UC] drop resource group shared_resource_group_for_vader; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| -- name: test_create_resource_group_with_mem_pool | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_test_user; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_test_user | ||
| to (user='test_user') | ||
| with ( | ||
| 'cpu_weight' = '12', | ||
| 'mem_limit' = '20%', | ||
| 'mem_pool' = 'test_pool_1' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_test_user; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| -- name: test_create_resource_group_with_mem_pool_then_try_alter | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_james; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_james | ||
| to (user='james') | ||
| with ( | ||
| 'cpu_weight' = '9', | ||
| 'mem_limit' = '66%', | ||
| 'max_cpu_cores' = "8", | ||
| 'mem_pool' = 'mem_pool_for_james' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'mem_limit' = '99%' | ||
| ); | ||
|
|
||
| alter resource group shared_resource_group_for_james with ( | ||
| 'max_cpu_cores' = "1" | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_james; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_john; | ||
| [UC] drop resource group shared_resource_group_for_jane; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_john | ||
| to (user='john') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_john_and_jane' | ||
| ); | ||
|
|
||
|
|
||
| [UC] create resource group shared_resource_group_for_jane | ||
| to (user='jane') | ||
| with ( | ||
| 'cpu_weight' = '8', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_john_and_jane' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| show verbose resource groups all; | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_john; | ||
| [UC] drop resource group shared_resource_group_for_jane; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool_different_mem_limit | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_alex; | ||
| [UC] drop resource group shared_resource_group_for_brad; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_alex | ||
| to (user='alex') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '55%', | ||
| 'mem_pool' = 'shared_pool_for_alex_and_brad' | ||
| ); | ||
|
|
||
| create resource group shared_resource_group_for_brad | ||
| to (user='brad') | ||
| with ( | ||
| 'cpu_weight' = '7', | ||
| 'mem_limit' = '88%', | ||
| 'mem_pool' = 'shared_pool_for_alex_and_brad' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
| show verbose resource groups all; | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_alex; | ||
| [UC] drop resource group shared_resource_group_for_brad; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| -- name: test_create_two_resource_groups_with_mem_pool_then_try_alter | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_skywalker; | ||
| [UC] drop resource group shared_resource_group_for_vader; | ||
|
|
||
| [UC] create resource group shared_resource_group_for_skywalker | ||
| to (user='skywalker') | ||
| with ( | ||
| 'cpu_weight' = '2', | ||
| 'mem_limit' = '70%', | ||
| 'mem_pool' = 'shared_pool_skywalker_and_vader' | ||
| ); | ||
|
|
||
|
|
||
| [UC] create resource group shared_resource_group_for_vader | ||
| to (user='vader') | ||
| with ( | ||
| 'cpu_weight' = '2', | ||
| 'mem_limit' = '70%', | ||
| 'mem_pool' = 'shared_pool_skywalker_and_vader' | ||
| ); | ||
|
|
||
| show verbose resource groups all; | ||
|
|
||
| show verbose resource groups all; | ||
|
|
||
| alter resource group shared_resource_group_for_vader with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
|
|
||
| alter resource group shared_resource_group_for_skywalker with ( | ||
| 'mem_limit' = '99%', | ||
| 'mem_pool' = 'other_pool' | ||
| ); | ||
|
|
||
| [UC] drop resource group shared_resource_group_for_skywalker; | ||
| [UC] drop resource group shared_resource_group_for_vader; |
Uh oh!
There was an error while loading. Please reload this page.