You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by nv...@apache.org on 2023/08/22 07:42:02 UTC

[incubator-pekko-persistence-cassandra] branch main updated: Fix flaky tests (#88)

This is an automated email from the ASF dual-hosted git repository.

nvollmar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-persistence-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new d130a9b  Fix flaky tests (#88)
d130a9b is described below

commit d130a9b00b684bf4dde455b10733da956e87fb2f
Author: Nicolas Vollmar <nv...@gmail.com>
AuthorDate: Tue Aug 22 09:41:57 2023 +0200

    Fix flaky tests (#88)
---
 .../pekko/persistence/cassandra/query/EventsByTagSpec.scala   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/core/src/test/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagSpec.scala
index a8ee9c6..e4e4ca8 100644
--- a/core/src/test/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagSpec.scala
+++ b/core/src/test/scala/org/apache/pekko/persistence/cassandra/query/EventsByTagSpec.scala
@@ -14,10 +14,9 @@
 package org.apache.pekko.persistence.cassandra.query
 
 import java.time.temporal.ChronoUnit
-import java.time.{ LocalDateTime, ZoneOffset }
+import java.time.{ LocalDate, LocalDateTime, ZoneOffset }
 import java.util.Optional
 import java.util.UUID
-
 import org.apache.pekko
 import pekko.actor.{ PoisonPill, Props }
 import pekko.event.Logging.Warning
@@ -37,8 +36,8 @@ import com.datastax.oss.driver.api.core.CqlIdentifier
 import com.datastax.oss.driver.api.core.uuid.Uuids
 import com.typesafe.config.{ Config, ConfigFactory }
 import org.scalatest.BeforeAndAfterEach
-import scala.concurrent.duration._
 
+import scala.concurrent.duration._
 import pekko.persistence.cassandra.PluginSettings
 
 object EventsByTagSpec {
@@ -50,7 +49,7 @@ object EventsByTagSpec {
     }
   }
 
-  val today = LocalDateTime.now(ZoneOffset.UTC)
+  val today = LocalDate.now(ZoneOffset.UTC).atStartOfDay()
 
   val config = ConfigFactory.parseString(s"""
     pekko.actor.serialize-messages = off
@@ -1122,7 +1121,7 @@ class EventsByTagSpecBackTrackingLongRefreshInterval
       probe.expectNextPF { case e @ EventEnvelope(_, "p2", 1L, "e1") => e }
       // now a delayed events for p1 in the previous bucket, should be found by the short back track
       writeTaggedEvent(
-        today.minusDays(1).minusHours(1),
+        today.minusHours(1),
         PersistentRepr("e1", 1L, "p1", ""),
         Set(tagName),
         1,
@@ -1203,7 +1202,7 @@ class EventsByTagSpecBackTracking
 
       // now a delayed events for p1 in the previous bucket, further back than the short period
       writeTaggedEvent(
-        today.minusDays(1).minusHours(1),
+        today.minusHours(1),
         PersistentRepr("e3", 3L, "p1", ""),
         Set(tagName),
         3,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org