From 8d93682eba11c28c91c075a0de5536a1c26427d2 Mon Sep 17 00:00:00 2001 From: Keyur Panchal Date: Wed, 8 Jan 2025 08:33:18 -0700 Subject: [PATCH] Modify `ORDER BY` clause in flaky test Modifies the `ORDER BY` clause in the `hypercore_index_btree` test to guarantee the ordering of the query result. --- tsl/test/expected/hypercore_index_btree.out | 6 +++--- tsl/test/sql/hypercore_index_btree.sql | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tsl/test/expected/hypercore_index_btree.out b/tsl/test/expected/hypercore_index_btree.out index 6df931d5474..e6c06d9fd53 100644 --- a/tsl/test/expected/hypercore_index_btree.out +++ b/tsl/test/expected/hypercore_index_btree.out @@ -986,7 +986,7 @@ where c.oid = :'unique_chunk'::regclass; _hyper_7_19_chunk | hypercore (1 row) -select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time; +select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time, value; is_compressed_tid | time | value -------------------+------------------------------+------- t | Mon Jan 01 01:00:00 2024 PST | 1 @@ -1008,11 +1008,11 @@ select compress_chunk(:'unique_chunk'); (1 row) -- Everything's compressed -select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time; +select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time, value; is_compressed_tid | time | value -------------------+------------------------------+------- - t | Mon Jan 01 01:00:00 2024 PST | 3 t | Mon Jan 01 01:00:00 2024 PST | 1 + t | Mon Jan 01 01:00:00 2024 PST | 3 t | Mon Jan 01 02:00:00 2024 PST | 2 (3 rows) diff --git a/tsl/test/sql/hypercore_index_btree.sql b/tsl/test/sql/hypercore_index_btree.sql index 1edeb7ea952..e1ca7288d89 100644 --- a/tsl/test/sql/hypercore_index_btree.sql +++ b/tsl/test/sql/hypercore_index_btree.sql @@ -441,7 +441,7 @@ select c.relname, a.amname from pg_class c inner join pg_am a ON (c.relam = a.oid) where c.oid = :'unique_chunk'::regclass; -select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time; +select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time, value; -- Unique index creation should work but fail on uniqueness check \set ON_ERROR_STOP 0 @@ -452,7 +452,7 @@ create unique index time_key on uniquetable (time); select compress_chunk(:'unique_chunk'); -- Everything's compressed -select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time; +select _timescaledb_debug.is_compressed_tid(ctid), * from :unique_chunk order by time, value; -- Unique index creation should still fail \set ON_ERROR_STOP 0