Skip to content

Commit

Permalink
Fix flaky reorder regression test take 2
Browse files Browse the repository at this point in the history
In #7509 we added manual VACUUM in all involved relations to avoid
flaky output tests.

But looks like it is not working very well specially on Windows builds,
so now we're removing the output `found 0 removable, 0 nonremovable
row versions in 0 pages` to have a more predictable output test.

https://github.com/timescale/timescaledb/actions/runs/12322325859/job/34395659212?pr=7533#step:17:24
  • Loading branch information
fabriziomello committed Dec 13, 2024
1 parent ed7b36c commit 44ed760
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 78 deletions.
16 changes: 0 additions & 16 deletions test/expected/cluster-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ INSERT INTO cluster_test VALUES ('2017-01-20T09:00:01', 23.4, 1),
-- Run cluster
CLUSTER VERBOSE cluster_test USING cluster_test_time_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using index scan on "_hyper_1_1_chunk_cluster_test_time_idx"
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using index scan on "_hyper_1_2_chunk_cluster_test_time_idx"
INFO: "_hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Create a third chunk
INSERT INTO cluster_test VALUES ('2017-01-22T09:00:01', 19.5, 3);
-- Show clustered indexes
Expand All @@ -41,11 +39,8 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder just our table
CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using index scan on "_hyper_1_3_chunk_cluster_test_time_idx"
INFO: "_hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show clustered indexes, including new chunk
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -61,22 +56,15 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder all tables (although will only be our test table)
CLUSTER VERBOSE;
INFO: clustering "public.cluster_test" using sequential scan and sort
INFO: "cluster_test": found 0 removable, 0 nonremovable row versions in 0 pages
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Change the clustered index
CREATE INDEX ON cluster_test (time, location);
CLUSTER VERBOSE cluster_test using cluster_test_time_location_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show updated clustered indexes
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down Expand Up @@ -105,11 +93,8 @@ ORDER BY 1,2;

CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE cluster_test SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -135,7 +120,6 @@ ORDER BY 1,2;

CLUSTER VERBOSE _timescaledb_internal._hyper_1_1_chunk;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE _timescaledb_internal._hyper_1_1_chunk SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down
16 changes: 0 additions & 16 deletions test/expected/cluster-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ INSERT INTO cluster_test VALUES ('2017-01-20T09:00:01', 23.4, 1),
-- Run cluster
CLUSTER VERBOSE cluster_test USING cluster_test_time_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using index scan on "_hyper_1_1_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using index scan on "_hyper_1_2_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Create a third chunk
INSERT INTO cluster_test VALUES ('2017-01-22T09:00:01', 19.5, 3);
-- Show clustered indexes
Expand All @@ -41,11 +39,8 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder just our table
CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using index scan on "_hyper_1_3_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show clustered indexes, including new chunk
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -61,22 +56,15 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder all tables (although will only be our test table)
CLUSTER VERBOSE;
INFO: clustering "public.cluster_test" using sequential scan and sort
INFO: "public.cluster_test": found 0 removable, 0 nonremovable row versions in 0 pages
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Change the clustered index
CREATE INDEX ON cluster_test (time, location);
CLUSTER VERBOSE cluster_test using cluster_test_time_location_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show updated clustered indexes
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down Expand Up @@ -105,11 +93,8 @@ ORDER BY 1,2;

CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE cluster_test SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -135,7 +120,6 @@ ORDER BY 1,2;

CLUSTER VERBOSE _timescaledb_internal._hyper_1_1_chunk;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE _timescaledb_internal._hyper_1_1_chunk SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down
16 changes: 0 additions & 16 deletions test/expected/cluster-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ INSERT INTO cluster_test VALUES ('2017-01-20T09:00:01', 23.4, 1),
-- Run cluster
CLUSTER VERBOSE cluster_test USING cluster_test_time_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using index scan on "_hyper_1_1_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using index scan on "_hyper_1_2_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Create a third chunk
INSERT INTO cluster_test VALUES ('2017-01-22T09:00:01', 19.5, 3);
-- Show clustered indexes
Expand All @@ -41,11 +39,8 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder just our table
CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using index scan on "_hyper_1_3_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show clustered indexes, including new chunk
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -61,22 +56,15 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder all tables (although will only be our test table)
CLUSTER VERBOSE;
INFO: clustering "public.cluster_test" using sequential scan and sort
INFO: "public.cluster_test": found 0 removable, 0 nonremovable row versions in 0 pages
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Change the clustered index
CREATE INDEX ON cluster_test (time, location);
CLUSTER VERBOSE cluster_test using cluster_test_time_location_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show updated clustered indexes
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down Expand Up @@ -105,11 +93,8 @@ ORDER BY 1,2;

CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE cluster_test SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -135,7 +120,6 @@ ORDER BY 1,2;

CLUSTER VERBOSE _timescaledb_internal._hyper_1_1_chunk;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE _timescaledb_internal._hyper_1_1_chunk SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down
16 changes: 0 additions & 16 deletions test/expected/cluster-17.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ INSERT INTO cluster_test VALUES ('2017-01-20T09:00:01', 23.4, 1),
-- Run cluster
CLUSTER VERBOSE cluster_test USING cluster_test_time_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using index scan on "_hyper_1_1_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using index scan on "_hyper_1_2_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Create a third chunk
INSERT INTO cluster_test VALUES ('2017-01-22T09:00:01', 19.5, 3);
-- Show clustered indexes
Expand All @@ -41,11 +39,8 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder just our table
CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using index scan on "_hyper_1_3_chunk_cluster_test_time_idx"
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show clustered indexes, including new chunk
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -61,22 +56,15 @@ WHERE indisclustered = true ORDER BY 1;
-- Reorder all tables (although will only be our test table)
CLUSTER VERBOSE;
INFO: clustering "public.cluster_test" using sequential scan and sort
INFO: "public.cluster_test": found 0 removable, 0 nonremovable row versions in 0 pages
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Change the clustered index
CREATE INDEX ON cluster_test (time, location);
CLUSTER VERBOSE cluster_test using cluster_test_time_location_idx;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
-- Show updated clustered indexes
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down Expand Up @@ -105,11 +93,8 @@ ORDER BY 1,2;

CLUSTER VERBOSE cluster_test;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_2_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_2_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
INFO: clustering "_timescaledb_internal._hyper_1_3_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_3_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE cluster_test SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand All @@ -135,7 +120,6 @@ ORDER BY 1,2;

CLUSTER VERBOSE _timescaledb_internal._hyper_1_1_chunk;
INFO: clustering "_timescaledb_internal._hyper_1_1_chunk" using sequential scan and sort
INFO: "_timescaledb_internal._hyper_1_1_chunk": found 0 removable, 1 nonremovable row versions in 1 pages
ALTER TABLE _timescaledb_internal._hyper_1_1_chunk SET WITHOUT CLUSTER;
SELECT indexrelid::regclass, indisclustered
FROM pg_index
Expand Down
3 changes: 2 additions & 1 deletion test/runner_cleanup_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ sed -e '/<exclude_from_test>/,/<\/exclude_from_test>/d' \
-e 's! Memory: [0-9]\{1,\}kB!!' \
-e 's! Memory Usage: [0-9]\{1,\}kB!!' \
-e 's! Average Peak Memory: [0-9]\{1,\}kB!!' \
-e '/Heap Fetches: [0-9]\{1,\}/d' | \
-e '/Heap Fetches: [0-9]\{1,\}/d' \
-e '/found [0-9]\{1,\} removable, [0-9]\{1,\} nonremovable row versions in [0-9]\{1,\} pages/d' | \
grep -v 'DEBUG: rehashing catalog cache id' | \
grep -v 'DEBUG: compacted fsync request queue from' | \
grep -v 'DEBUG: creating and filling new WAL file' | \
Expand Down
Loading

0 comments on commit 44ed760

Please sign in to comment.