DBZ-1438 Reduce test runtime

This commit is contained in:
Jiri Pechanec 2019-09-24 11:11:27 +02:00 committed by Gunnar Morling
parent 8f308746d3
commit 9b2fcdc13a

View File

@ -469,7 +469,7 @@ public void shouldReceiveChangesForUpdates() throws Exception {
// without PK and with REPLICA IDENTITY DEFAULT we will get nothing
TestHelper.execute("ALTER TABLE test_table REPLICA IDENTITY DEFAULT;");
consumer.expects(0);
executeAndWait("UPDATE test_table SET text = 'no_pk_and_default' WHERE pk = 1;");
executeAndWaitForNoRecords("UPDATE test_table SET text = 'no_pk_and_default' WHERE pk = 1;");
assertThat(consumer.isEmpty()).isTrue();
}
@ -1505,4 +1505,9 @@ private void executeAndWait(String statements) throws Exception {
TestHelper.execute(statements);
consumer.await(TestHelper.waitTimeForRecords() * 30, TimeUnit.SECONDS);
}
private void executeAndWaitForNoRecords(String statements) throws Exception {
TestHelper.execute(statements);
consumer.await(5, TimeUnit.SECONDS);
}
}