Skip to content

Commit

Permalink
Add vacuum to fix flaky tests (#7452)
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzm authored Nov 18, 2024
1 parent 7e30ed6 commit f7cf167
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tsl/test/expected/compression.out
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,7 @@ SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i;
(1 row)

CALL reindex_compressed_hypertable('f_sensor_data');
VACUUM ANALYZE f_sensor_data;
-- Encourage use of parallel plans
SET parallel_setup_cost = 0;
SET parallel_tuple_cost = 0;
Expand Down Expand Up @@ -1827,7 +1828,7 @@ SELECT * FROM f_sensor_data WHERE sensor_id > 100;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gather
Output: _hyper_37_73_chunk."time", _hyper_37_73_chunk.sensor_id, _hyper_37_73_chunk.cpu, _hyper_37_73_chunk.temperature
Workers Planned: 2
Workers Planned: 3
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_37_73_chunk
Output: _hyper_37_73_chunk."time", _hyper_37_73_chunk.sensor_id, _hyper_37_73_chunk.cpu, _hyper_37_73_chunk.temperature
-> Parallel Index Scan using compress_hyper_38_74_chunk_sensor_id__ts_meta_min_1__ts_met_idx on _timescaledb_internal.compress_hyper_38_74_chunk
Expand Down
1 change: 1 addition & 0 deletions tsl/test/expected/compression_ddl.out
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,7 @@ SELECT compress_chunk(show_chunks('test_partials'));
_timescaledb_internal._hyper_33_122_chunk
(3 rows)

VACUUM ANALYZE test_partials;
-- fully compressed
EXPLAIN (costs off) SELECT * FROM test_partials ORDER BY time;
QUERY PLAN
Expand Down
2 changes: 2 additions & 0 deletions tsl/test/sql/compression.sql
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ ALTER TABLE f_sensor_data SET (timescaledb.compress, timescaledb.compress_segmen
SELECT compress_chunk(i) FROM show_chunks('f_sensor_data') i;
CALL reindex_compressed_hypertable('f_sensor_data');

VACUUM ANALYZE f_sensor_data;

-- Encourage use of parallel plans
SET parallel_setup_cost = 0;
SET parallel_tuple_cost = 0;
Expand Down
1 change: 1 addition & 0 deletions tsl/test/sql/compression_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ VALUES -- chunk1
-- enable compression, compress all chunks
ALTER TABLE test_partials SET (timescaledb.compress);
SELECT compress_chunk(show_chunks('test_partials'));
VACUUM ANALYZE test_partials;
-- fully compressed
EXPLAIN (costs off) SELECT * FROM test_partials ORDER BY time;
-- test P, F, F
Expand Down

0 comments on commit f7cf167

Please sign in to comment.