mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-25 17:10:38 +00:00
Add test functions to neon_test_utils to consume CPU, memory, or local disk.
This is handy for testing VM autoscaling.
This commit is contained in:
15
test_runner/sql_regress/sql/neon-test-utils.sql
Normal file
15
test_runner/sql_regress/sql/neon-test-utils.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- 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
|
||||
|
||||
select test_consume_disk_space(20); -- Allocate 20 MB of disk space
|
||||
select test_release_disk_space(5); -- Release 5 MB
|
||||
select test_release_disk_space(); -- Release the remaining 15 MB
|
||||
Reference in New Issue
Block a user