DBZ-8123 Process compression notification messages

This commit is contained in:
Jiri Pechanec 2024-08-06 08:59:28 +02:00
parent c972cc1b25
commit 3e1bb6cbef

View File

@ -27,6 +27,7 @@
import io.debezium.embedded.AbstractConnectorTest;
import io.debezium.jdbc.JdbcConfiguration;
import io.debezium.testing.testcontainers.ImageNames;
import io.debezium.util.Testing;
public class TimescaleDbDatabaseTest extends AbstractConnectorTest {
@ -145,7 +146,7 @@ public void shouldTransformAggregates() throws Exception {
@Test
public void shouldTransformCompressedChunks() throws Exception {
// Testing.Print.enable();
Testing.Print.enable();
start(PostgresConnector.class, config);
waitForStreamingRunning("postgres", TestHelper.TEST_SERVER);
@ -155,7 +156,8 @@ public void shouldTransformCompressedChunks() throws Exception {
"ALTER TABLE conditions SET (timescaledb.compress, timescaledb.compress_orderby = 'time DESC', timescaledb.compress_segmentby = 'location')",
"SELECT compress_chunk('_timescaledb_internal._hyper_1_1_chunk')");
var records = consumeRecordsByTopic(4);
// 3 data messages, 1 raw compressed chunk message, 2 WAL notification messages about compression in progress
var records = consumeRecordsByTopic(6);
assertConnectorIsRunning();
assertThat(records.recordsForTopic("timescaledb.public.conditions")).hasSize(3);