From 660fa32ae29b7d7fd0e14d1d73f025a01ce90386 Mon Sep 17 00:00:00 2001 From: John Naylor Date: Sun, 7 Apr 2024 16:16:01 +0700 Subject: [PATCH v84 7/8] DEV log memory usage in tests --- src/test/modules/test_tidstore/expected/test_tidstore.out | 4 ++-- src/test/modules/test_tidstore/sql/test_tidstore.sql | 4 ++-- src/test/modules/test_tidstore/test_tidstore.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/modules/test_tidstore/expected/test_tidstore.out b/src/test/modules/test_tidstore/expected/test_tidstore.out index c40779859b..aae86579e3 100644 --- a/src/test/modules/test_tidstore/expected/test_tidstore.out +++ b/src/test/modules/test_tidstore/expected/test_tidstore.out @@ -54,8 +54,8 @@ SELECT do_set_block_offsets(502, array_agg(DISTINCT greatest((random() * :maxoff -- to the allocated memory it started out with. This is easier -- with memory contexts in local memory. INSERT INTO hideblocks (blockno) -SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63,64,200]::int2[]) - FROM generate_series(1000, 2000, 1) blk; +SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63]::int2[]) + FROM generate_series(1000, 200000, 1) blk; -- Zero offset not allowed SELECT do_set_block_offsets(1, ARRAY[0]::int2[]); ERROR: tuple offset out of range: 0 diff --git a/src/test/modules/test_tidstore/sql/test_tidstore.sql b/src/test/modules/test_tidstore/sql/test_tidstore.sql index 1f4e4a807e..7b64b0bf58 100644 --- a/src/test/modules/test_tidstore/sql/test_tidstore.sql +++ b/src/test/modules/test_tidstore/sql/test_tidstore.sql @@ -37,8 +37,8 @@ SELECT do_set_block_offsets(502, array_agg(DISTINCT greatest((random() * :maxoff -- to the allocated memory it started out with. This is easier -- with memory contexts in local memory. INSERT INTO hideblocks (blockno) -SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63,64,200]::int2[]) - FROM generate_series(1000, 2000, 1) blk; +SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63]::int2[]) + FROM generate_series(1000, 200000, 1) blk; -- Zero offset not allowed SELECT do_set_block_offsets(1, ARRAY[0]::int2[]); diff --git a/src/test/modules/test_tidstore/test_tidstore.c b/src/test/modules/test_tidstore/test_tidstore.c index 0a3a58722d..e4aad4dabb 100644 --- a/src/test/modules/test_tidstore/test_tidstore.c +++ b/src/test/modules/test_tidstore/test_tidstore.c @@ -291,6 +291,7 @@ test_is_full(PG_FUNCTION_ARGS) bool is_full; is_full = (TidStoreMemoryUsage(tidstore) > tidstore_empty_size); + fprintf(stderr, "TID bytes%zu\n", TidStoreMemoryUsage(tidstore)); PG_RETURN_BOOL(is_full); } -- 2.44.0