You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/05/31 08:14:16 UTC

[GitHub] [james-project] chibenwa commented on a diff in pull request #1033: Fixing unit test CassandraSieveDAOTest.deleteScriptInCassandraShouldWork

chibenwa commented on code in PR #1033:
URL: https://github.com/apache/james-project/pull/1033#discussion_r885336359


##########
server/data/data-cassandra/src/test/java/org/apache/james/sieve/cassandra/CassandraSieveDAOTest.java:
##########
@@ -105,10 +113,11 @@ void insertScriptShouldUpdateActivate() {
     void deleteScriptInCassandraShouldWork() {
         sieveDAO.insertScript(USERNAME, SCRIPT).block();
 
-        sieveDAO.deleteScriptInCassandra(USERNAME, SCRIPT_NAME).block();
-
-        Optional<Script> actual = sieveDAO.getScript(USERNAME, SCRIPT_NAME).blockOptional();
-        assertThat(actual).isEmpty();
+        CALMLY_AWAIT.atMost(Durations.TEN_SECONDS)
+            .untilAsserted(() -> {
+                sieveDAO.deleteScriptInCassandra(USERNAME, SCRIPT_NAME).block();
+                assertThat(sieveDAO.getScript(USERNAME, SCRIPT_NAME).blockOptional()).isEmpty();
+            });

Review Comment:
   Could we know why in the first place the deletion is not instantaneous?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org