DBZ-7588 Disable debug prints on tests

This commit is contained in:
mfvitale 2024-03-01 09:32:53 +01:00 committed by Chris Cranford
parent aca2464862
commit 8a47b2333d
14 changed files with 34 additions and 39 deletions

View File

@ -28,7 +28,6 @@
import io.debezium.converters.CloudEventsConverterTest;
import io.debezium.data.Envelope;
import io.debezium.doc.FixFor;
import io.debezium.util.Testing;
/**
* Test to verify MongoDB connector behaviour with CloudEvents converter for all streaming events.
@ -43,7 +42,7 @@ public class CloudEventsConverterIT extends AbstractMongoConnectorIT {
@Before
public void beforeEach() {
Testing.Print.enable();
// Testing.Print.enable();
config = getConfiguration();
context = new MongoDbTaskContext(config);
TestHelper.cleanDatabase(mongo, DB_NAME);

View File

@ -17,7 +17,6 @@
import io.debezium.doc.FixFor;
import io.debezium.schema.AbstractTopicNamingStrategy;
import io.debezium.util.Collect;
import io.debezium.util.Testing;
/**
* Transaction metadata integration test for Debezium MongoDB connector.
@ -28,7 +27,7 @@ public class TransactionMetadataIT extends AbstractMongoConnectorIT {
@Test
public void transactionMetadata() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
config = TestHelper.getConfiguration(mongo)
.edit()
.with(MongoDbConnectorConfig.COLLECTION_INCLUDE_LIST, "dbA.c1")
@ -80,7 +79,7 @@ public void transactionMetadata() throws Exception {
@Test
@FixFor("DBZ-4077")
public void transactionMetadataWithCustomTopicName() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
config = TestHelper.getConfiguration(mongo)
.edit()
.with(MongoDbConnectorConfig.COLLECTION_INCLUDE_LIST, "dbA.c1")

View File

@ -281,7 +281,7 @@ public void updates() throws Exception {
@Test
@FixFor("DBZ-4939")
public void tableWithDatetime() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final int ROWS = 10;
try (JdbcConnection connection = databaseConnection()) {
@ -334,7 +334,7 @@ record -> {
@Test
@FixFor("DBZ-5099")
public void tableWithZeroDate() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final LogInterceptor logInterceptor = new LogInterceptor(MySqlBinaryProtocolFieldReader.class);
try (JdbcConnection connection = databaseConnection()) {

View File

@ -49,7 +49,7 @@ public class MySqlMetricsIT extends AbstractAsyncEngineConnectorTest {
@Before
public void before() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
stopConnector();
DATABASE.createAndInitialize();
initializeConnectorTestFramework();
@ -319,7 +319,7 @@ private void assertStreamingMetrics(long events) throws Exception {
waitForAvailableRecords(30, TimeUnit.SECONDS);
Testing.Print.enable();
// Testing.Print.enable();
int size = consumeAvailableRecords(VerifyRecord::print);
// Check streaming metrics

View File

@ -94,7 +94,7 @@ public Configuration.Builder defaultConfig() {
public void parseTableWithVisibleColumns() throws SQLException, InterruptedException {
config = defaultConfig().build();
Testing.Print.enable();
// Testing.Print.enable();
try (MySqlTestConnection db = MySqlTestConnection.forTestDatabase(DB_NAME, mySQLContainer.getUsername(), mySQLContainer.getPassword())) {
try (JdbcConnection connection = db.connect()) {
@ -128,7 +128,7 @@ public void parseTableWithVisibleColumns() throws SQLException, InterruptedExcep
public void parseTableWithInVisibleColumns() throws SQLException, InterruptedException {
config = defaultConfig().build();
Testing.Print.enable();
// Testing.Print.enable();
try (MySqlTestConnection db = MySqlTestConnection.forTestDatabase(DB_NAME, mySQLContainer.getUsername(), mySQLContainer.getPassword())) {
try (JdbcConnection connection = db.connect()) {

View File

@ -57,7 +57,7 @@ public void useStringsDuringSnapshots() throws InterruptedException, SQLExceptio
.build();
start(MySqlConnector.class, config);
Testing.Print.enable();
// Testing.Print.enable();
AbstractConnectorTest.SourceRecords records = consumeRecordsByTopic(7);
final SourceRecord record = records.recordsForTopic(DATABASE.topicForTable("DATA")).get(0);
@ -90,7 +90,7 @@ public void useByteArrayDuringSnapshots() throws InterruptedException, SQLExcept
.build();
start(MySqlConnector.class, config);
Testing.Print.enable();
// Testing.Print.enable();
AbstractConnectorTest.SourceRecords records = consumeRecordsByTopic(7);
final SourceRecord record = records.recordsForTopic(DATABASE.topicForTable("DATA")).get(0);

View File

@ -193,7 +193,7 @@ protected String server() {
@Test
@FixFor("DBZ-6481")
public void insertsEnumPk() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final var enumValues = List.of("UP", "DOWN", "LEFT", "RIGHT", "STORY");
try (JdbcConnection connection = databaseConnection()) {

View File

@ -102,7 +102,6 @@
import io.debezium.relational.TableId;
import io.debezium.schema.DatabaseSchema;
import io.debezium.util.Strings;
import io.debezium.util.Testing;
/**
* Integration test for {@link PostgresConnector} using an {@link io.debezium.engine.DebeziumEngine}
@ -393,7 +392,7 @@ public void shouldConsumeMessagesFromSnapshotOld() throws Exception {
@Test
@FixFor("DBZ-997")
public void shouldReceiveChangesForChangePKColumnDefinition() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final String slotName = "pkcolumndef" + new Random().nextInt(100);
TestHelper.create().dropReplicationSlot(slotName);
try {
@ -491,7 +490,7 @@ public void shouldReceiveChangesForChangePKColumnDefinition() throws Exception {
@Test
public void shouldReceiveChangesForChangeColumnDefault() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final String slotName = "default_change" + new Random().nextInt(100);
TestHelper.create().dropReplicationSlot(slotName);
try {
@ -647,7 +646,7 @@ public void shouldReceiveChangesForChangeColumnDefault() throws Exception {
@Test
public void showThatSchemaColumnDefaultMayApplyRetroactively() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final String slotName = "default_change" + new Random().nextInt(100);
try (PostgresConnection conn = TestHelper.create()) {
conn.dropReplicationSlot(slotName);
@ -939,7 +938,7 @@ public void shouldExecuteOnConnectStatements() throws Exception {
@Test
public void shouldProduceEventsWhenSnapshotsAreNeverAllowed() throws InterruptedException {
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.dropDefaultReplicationSlot();
TestHelper.execute(SETUP_TABLES_STMT);
Configuration config = TestHelper.defaultConfig()
@ -961,7 +960,7 @@ public void shouldProduceEventsWhenSnapshotsAreNeverAllowed() throws Interrupted
@Test
public void shouldNotProduceEventsWithInitialOnlySnapshot() throws InterruptedException {
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.execute(SETUP_TABLES_STMT);
Configuration config = TestHelper.defaultConfig()
.with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.INITIAL_ONLY.getValue())
@ -2042,7 +2041,7 @@ public void customSnapshotterSkipsTablesOnRestart() throws Exception {
public void customSnapshotterSkipsTablesOnRestartWithConcurrentTx() throws Exception {
final LogInterceptor logInterceptor = new LogInterceptor(RelationalSnapshotChangeEventSource.class);
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.execute(SETUP_TABLES_STMT);
// Perform an regular snapshot using the always snapshotter
Configuration config = TestHelper.defaultConfig()
@ -2743,7 +2742,7 @@ public void shouldOutputRecordsInCloudEventsFormat() throws Exception {
waitForStreamingRunning();
TestHelper.execute(INSERT_STMT);
Testing.Print.enable();
// Testing.Print.enable();
final List<SourceRecord> streaming = new ArrayList<SourceRecord>();
Awaitility.await().atMost(TestHelper.waitTimeForRecords(), TimeUnit.SECONDS).until(() -> {
@ -3016,7 +3015,7 @@ public void shouldUpdateExistingPublicationForConfiguredPartitionedTables() thro
@Test
public void shouldEmitNoEventsForSkippedCreateOperations() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.dropDefaultReplicationSlot();
TestHelper.execute(SETUP_TABLES_STMT);
Configuration config = TestHelper.defaultConfig()

View File

@ -31,7 +31,6 @@
import io.debezium.heartbeat.Heartbeat;
import io.debezium.jdbc.JdbcConfiguration;
import io.debezium.testing.testcontainers.util.ContainerImageVersions;
import io.debezium.util.Testing;
/**
* Integration test for {@link PostgresConnector} using an {@link EmbeddedEngine} and Testcontainers infrastructure for when Postgres is shutdown during streaming
@ -109,7 +108,7 @@ public void shouldStopOnPostgresFastShutdown() throws Exception {
.with(Heartbeat.HEARTBEAT_INTERVAL, 500)
.with(DatabaseHeartbeatImpl.HEARTBEAT_ACTION_QUERY, "UPDATE s1.heartbeat SET ts=NOW();");
Testing.Print.enable();
// Testing.Print.enable();
PostgresConnection postgresConnection = TestHelper.create();
String initialHeartbeat = postgresConnection.queryAndMap(
"SELECT ts FROM s1.heartbeat;",

View File

@ -145,7 +145,7 @@ public void before() throws Exception {
.with("assumeMinServerVersion.set", "9.4");
}
Testing.Print.enable();
// Testing.Print.enable();
}
private void startConnector(Function<Configuration.Builder, Configuration.Builder> customConfig, boolean waitForSnapshot, Predicate<SourceRecord> isStopRecord)
@ -229,7 +229,7 @@ public void shouldReceiveChangesForInsertsWithDifferentDataTypes() throws Except
@Test
@FixFor("DBZ-5014")
public void shouldReceiveDeletesWithInfinityDate() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.executeDDL("postgres_create_tables.ddl");
TestHelper.execute("ALTER TABLE time_table REPLICA IDENTITY FULL");
startConnector();
@ -1386,7 +1386,7 @@ public void shouldPropagateSourceColumnTypeScaleToSchemaParameter() throws Excep
@Test
@FixFor("DBZ-800")
public void shouldReceiveHeartbeatAlsoWhenChangingNonWhitelistedTable() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
startConnector(config -> config
.with(Heartbeat.HEARTBEAT_INTERVAL, "100")
.with(PostgresConnectorConfig.POLL_INTERVAL_MS, "50")
@ -1756,7 +1756,7 @@ public void shouldHandleToastedDateArrayColumn() throws Exception {
@Test
@FixFor("DBZ-6122")
public void shouldHandleToastedByteArrayColumn() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
TestHelper.execute(
"DROP TABLE IF EXISTS test_toast_table;",
"CREATE TABLE test_toast_table (id SERIAL PRIMARY KEY);");
@ -2604,7 +2604,7 @@ public void shouldProcessLargerTx() throws Exception {
@Test
@FixFor("DBZ-1824")
public void stopInTheMiddleOfTxAndResume() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final int numberOfEvents = 50;
final int STOP_ID = 20;
@ -2654,7 +2654,7 @@ public void stopInTheMiddleOfTxAndResume() throws Exception {
@Test
@FixFor("DBZ-2397")
public void restartConnectorInTheMiddleOfUncommittedTx() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
final PostgresConnection tx1Connection = TestHelper.create();
tx1Connection.setAutoCommit(false);
@ -2697,7 +2697,7 @@ public void restartConnectorInTheMiddleOfUncommittedTx() throws Exception {
@Test
@FixFor("DBZ-1730")
public void shouldStartConsumingFromSlotLocation() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
startConnector(config -> config
.with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, false)

View File

@ -151,7 +151,7 @@ private PgConnection getUnderlyingConnection(ReplicationConnection connection) t
@Test
public void shouldDetectRunningConncurrentTxOnInit() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
// drop the slot from the previous connection
final String slotName = "block";
try (PostgresConnection connection = TestHelper.create()) {

View File

@ -27,7 +27,6 @@
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 {
@ -98,7 +97,7 @@ protected void insertData() throws SQLException {
@Test
public void shouldTransformChunks() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
start(PostgresConnector.class, config);
waitForStreamingRunning("postgres", TestHelper.TEST_SERVER);
@ -116,7 +115,7 @@ public void shouldTransformChunks() throws Exception {
@Test
public void shouldTransformAggregates() throws Exception {
Testing.Print.enable();
// Testing.Print.enable();
start(PostgresConnector.class, config);
waitForStreamingRunning("postgres", TestHelper.TEST_SERVER);
@ -146,7 +145,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);

View File

@ -103,7 +103,7 @@ public void shouldEnableCdcWithWrapperFunctionsForTable() throws Exception {
// and issue a test call to a CDC wrapper function
Thread.sleep(5_000); // Need to wait to make sure the min_lsn is available
Testing.Print.enable();
// Testing.Print.enable();
connection.query(
"select * from cdc.fn_cdc_get_all_changes_dbo_testTable(sys.fn_cdc_get_min_lsn('dbo_testTable'), sys.fn_cdc_get_max_lsn(), N'all')",
rs -> {

View File

@ -172,7 +172,7 @@ public void shouldStreamChangesAfterRestart() throws InterruptedException, SQLEx
start(MySqlConnector.class, config);
waitForStreamingRunning("mysql", TOPIC_PREFIX);
Testing.Print.enable();
// Testing.Print.enable();
SourceRecords records = consumeRecordsByTopic(4); // 4 DML changes
assertThat(records.topics().size()).isEqualTo(1);
assertThat(records.recordsForTopic(topicName())).hasSize(4);