diff --git a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueStatisticsSuite.scala b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueStatisticsSuite.scala index 009d200..b566b02 100644 --- a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueStatisticsSuite.scala +++ b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueStatisticsSuite.scala @@ -65,7 +65,7 @@ trait QueueStatisticsSuite extends CatsEffectSuite { self: QueueClientSuite => client = clientFixture() _ <- Stream .emits(messages) // putting a really long delay so that the test can pass even in slow envs - .through(client.publish(queueName).sink(batchSize = 30, delay = 1.minute.some)) + .through(client.publish(queueName).sink(batchSize = 10, delay = 1.minute.some)) .compile .drain _ <- client diff --git a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala index 2abe296..a372ba0 100644 --- a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala +++ b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala @@ -137,8 +137,9 @@ trait QueueSubscriberSuite extends CatsEffectSuite { self: QueueClientSuite => toBeNacked <- toBeNackedRef.get _ = assertEquals(toBeAcked, Set("0", "2", "4", "6", "8")) _ = assertEquals(toBeNacked, Set("1", "3", "5", "7", "9")) - remaining <- client.statistics(queueName).fetcher.use(_.fetch).map(_.messages) - _ = assertEquals(remaining, 5, "not all the expected messages got nacked") + stats <- client.statistics(queueName).fetcher.use(_.fetch) + // it may take a while to move the inflight messages back + _ = assert(stats.messages + stats.inflight.getOrElse(0) == 5, "not all the expected messages got nacked") } yield () }