Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added echo
Empty file.
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\]
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

-- !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]
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

Copy link
Contributor

Choose a reason for hiding this comment

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

@arin-mirza need to fix or resolve this comment

Copy link
Contributor

Choose a reason for hiding this comment

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

it should be [REGEX]^shared_resource_group_for_brad

-- !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;
Loading