Skip to content

Commit

Permalink
Make ScyllaSniProxyTest tests to wait before checking on events API (s…
Browse files Browse the repository at this point in the history
…cylladb#359)

calls

ScyllaSniProxyTest tests creates a table and right away check of
listener APIs.
Since listener API is called asynchronously it can fail.
  • Loading branch information
dkropachev authored Oct 8, 2024
1 parent ec66feb commit 701b745
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public void onTableAdded(TableMetadata table) {

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

0 comments on commit 701b745

Please sign in to comment.