From f3bd0391f1d87c237d6d3bded5aa9f1b8002ea2f Mon Sep 17 00:00:00 2001 From: Jakub Chrobasik Date: Mon, 25 Sep 2023 19:33:41 +0200 Subject: [PATCH] fix: flaky MetricsServiceSpec --- .../renku/triplesgenerator/metrics/MetricsServiceSpec.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/triples-generator/src/test/scala/io/renku/triplesgenerator/metrics/MetricsServiceSpec.scala b/triples-generator/src/test/scala/io/renku/triplesgenerator/metrics/MetricsServiceSpec.scala index ea07d387a3..5f29145815 100644 --- a/triples-generator/src/test/scala/io/renku/triplesgenerator/metrics/MetricsServiceSpec.scala +++ b/triples-generator/src/test/scala/io/renku/triplesgenerator/metrics/MetricsServiceSpec.scala @@ -46,7 +46,7 @@ class MetricsServiceSpec extends AsyncWordSpec with AsyncIOSpec with should.Matc for { _ <- service(notFailingCollection).collectEvery(500 millis).start.void - _ <- Temporal[IO].sleep(pace * cycles) + _ <- Temporal[IO].sleep((pace * cycles) + 100.millis) _ <- collected.get.asserting(_.size shouldBe >=(cycles)) res <- collected.get .map(list => list.zip(list.tail).map { case (l, r) => l.toMillis - r.toMillis }) @@ -76,7 +76,7 @@ class MetricsServiceSpec extends AsyncWordSpec with AsyncIOSpec with should.Matc for { _ <- service(failingCollection).collectEvery(500 millis).start.void - _ <- Temporal[IO].sleep(pace * cycles) + _ <- Temporal[IO].sleep((pace * cycles) + 100.millis) _ <- collected.get.asserting(_.isEmpty shouldBe false) _ <- collected.get .map(list => list.zip(list.tail).map { case (l, r) => l.toMillis - r.toMillis })