-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resource consume test funcs (#6747)
## Problem Building on #5875 to add handy test functions for autoscaling. Resolves #5609 ## Summary of changes This PR makes the following changes to #5875: - Enable `neon_test_utils` extension in the compute node docker image, so we could use it in the e2e tests (as discussed with @kelvich). - Removed test functions related to disk as we don't use them for autoscaling. - Fix the warning with printf-ing unsigned long variables. --------- Co-authored-by: Heikki Linnakangas <[email protected]>
- Loading branch information
Showing
7 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Test the test utils in pgxn/neon_test_utils. We don't test that | ||
-- these actually consume resources like they should - that would be | ||
-- tricky - but at least we check that they don't crash. | ||
CREATE EXTENSION neon_test_utils; | ||
select test_consume_cpu(1); | ||
test_consume_cpu | ||
------------------ | ||
|
||
(1 row) | ||
|
||
select test_consume_memory(20); -- Allocate 20 MB | ||
test_consume_memory | ||
--------------------- | ||
|
||
(1 row) | ||
|
||
select test_release_memory(5); -- Release 5 MB | ||
test_release_memory | ||
--------------------- | ||
|
||
(1 row) | ||
|
||
select test_release_memory(); -- Release the remaining 15 MB | ||
test_release_memory | ||
--------------------- | ||
|
||
(1 row) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
test: neon-cid | ||
test: neon-rel-truncate | ||
test: neon-clog | ||
test: neon-test-utils | ||
test: neon-vacuum-full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Test the test utils in pgxn/neon_test_utils. We don't test that | ||
-- these actually consume resources like they should - that would be | ||
-- tricky - but at least we check that they don't crash. | ||
|
||
CREATE EXTENSION neon_test_utils; | ||
|
||
select test_consume_cpu(1); | ||
|
||
select test_consume_memory(20); -- Allocate 20 MB | ||
select test_release_memory(5); -- Release 5 MB | ||
select test_release_memory(); -- Release the remaining 15 MB |
fff2468
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2511 tests run: 2383 passed, 2 failed, 126 skipped (full report)
Failures on Postgres 14
test_pageserver_max_throughput_getpage_at_latest_lsn[1-6-30]
: releasetest_pageserver_max_throughput_getpage_at_latest_lsn[1-13-30]
: releaseFlaky tests (2)
Postgres 16
test_sharding_split_unsharded
: releasePostgres 15
test_create_snapshot
: releaseTest coverage report is not available
fff2468 at 2024-02-14T19:44:12.906Z :recycle: