Skip to content

Commit

Permalink
DBZ-5525 Fix test failures - EventProcessingFailureHandlingIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 18, 2022
1 parent fcd2664 commit 6f5e858
Showing 1 changed file with 23 additions and 5 deletions.
Expand Up @@ -69,7 +69,13 @@ public void warn() throws Exception {

start(SqlServerConnector.class, config);
assertConnectorIsRunning();
TestHelper.waitForSnapshotToBeCompleted();
TestHelper.waitForStreamingStarted();

connection.execute("INSERT INTO tablea VALUES (1, 'seed')");

SourceRecords records = consumeRecordsByTopic(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tablea")).hasSize(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tableb")).isNull();

// Will allow insertion of strings into what was originally a BIGINT NOT NULL column
// This will cause NumberFormatExceptions which return nulls and thus an error due to the column being NOT NULL
Expand All @@ -83,7 +89,7 @@ public void warn() throws Exception {
"INSERT INTO tableb VALUES(" + id + ", 'b')");
}

SourceRecords records = consumeRecordsByTopic(RECORDS_PER_TABLE);
records = consumeRecordsByTopic(RECORDS_PER_TABLE);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tablea")).hasSize(RECORDS_PER_TABLE);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tableb")).isNull();

Expand All @@ -105,7 +111,13 @@ public void ignore() throws Exception {

start(SqlServerConnector.class, config);
assertConnectorIsRunning();
TestHelper.waitForSnapshotToBeCompleted();
TestHelper.waitForStreamingStarted();

connection.execute("INSERT INTO tablea VALUES (1, 'seed')");

SourceRecords records = consumeRecordsByTopic(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tablea")).hasSize(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tableb")).isNull();

// Will allow insertion of strings into what was originally a BIGINT NOT NULL column
// This will cause NumberFormatExceptions which return nulls and thus an error due to the column being NOT NULL
Expand All @@ -119,7 +131,7 @@ public void ignore() throws Exception {
"INSERT INTO tableb VALUES(" + id + ", 'b')");
}

SourceRecords records = consumeRecordsByTopic(RECORDS_PER_TABLE);
records = consumeRecordsByTopic(RECORDS_PER_TABLE);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tablea")).hasSize(RECORDS_PER_TABLE);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tableb")).isNull();
}
Expand All @@ -135,7 +147,13 @@ public void fail() throws Exception {

start(SqlServerConnector.class, config);
assertConnectorIsRunning();
TestHelper.waitForSnapshotToBeCompleted();
TestHelper.waitForStreamingStarted();

connection.execute("INSERT INTO tablea VALUES (1, 'seed')");

SourceRecords records = consumeRecordsByTopic(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tablea")).hasSize(1);
Assertions.assertThat(records.recordsForTopic("server1.testDB1.dbo.tableb")).isNull();

// Will allow insertion of strings into what was originally a BIGINT NOT NULL column
// This will cause NumberFormatExceptions which return nulls and thus an error due to the column being NOT NULL
Expand Down

0 comments on commit 6f5e858

Please sign in to comment.