Skip to content

Commit 701b745

Browse files
authored
Make ScyllaSniProxyTest tests to wait before checking on events API (#359)
calls ScyllaSniProxyTest tests creates a table and right away check of listener APIs. Since listener API is called asynchronously it can fail.
1 parent ec66feb commit 701b745

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

driver-core/src/test/java/com/datastax/driver/core/ScyllaSniProxyTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public void onTableAdded(TableMetadata table) {
6969

7070
// Sometimes (probably due to reconnection) both events can be read twice
7171
// assertingListener ensures we deal with the same keyspace and table
72+
try {
73+
Thread.sleep(1000);
74+
} catch (InterruptedException ignored) {
75+
}
7276
verify(listener, atLeast(1)).onTableAdded(any(TableMetadata.class));
7377
verify(listener, atMost(2)).onTableAdded(any(TableMetadata.class));
7478
verify(listener, atLeast(1)).onKeyspaceAdded(any(KeyspaceMetadata.class));

0 commit comments

Comments
 (0)