Skip to content

Commit

Permalink
Fix flaky reorder regression test
Browse files Browse the repository at this point in the history
Execute manual `VACUUM` on the hypertable before reordering a chunk to
avoid flaky test output.
  • Loading branch information
fabriziomello committed Dec 3, 2024
1 parent 02b76fa commit 8fe7241
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tsl/test/expected/reorder.out
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,10 @@ CREATE INDEX ct2_time_idx ON ct2(time DESC);
CLUSTER ct2 USING ct2_time_idx;
-- deleted chunks are removed correctly
DELETE FROM ct2 where time < 2 OR val < 2;
VACUUM ct2;
SELECT reorder_chunk('_timescaledb_internal._hyper_2_3_chunk', verbose => TRUE);
INFO: reordering "_timescaledb_internal._hyper_2_3_chunk" using sequential scan and sort
INFO: "_hyper_2_3_chunk": found 2 removable, 3 nonremovable row versions in 1 pages
INFO: "_hyper_2_3_chunk": found 0 removable, 3 nonremovable row versions in 1 pages
reorder_chunk
---------------

Expand Down
1 change: 1 addition & 0 deletions tsl/test/sql/reorder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ CLUSTER ct2 USING ct2_time_idx;

-- deleted chunks are removed correctly
DELETE FROM ct2 where time < 2 OR val < 2;
VACUUM ct2;

SELECT reorder_chunk('_timescaledb_internal._hyper_2_3_chunk', verbose => TRUE);
SELECT ctid, time, val FROM _timescaledb_internal._hyper_2_3_chunk ORDER BY time;
Expand Down

0 comments on commit 8fe7241

Please sign in to comment.