Skip to content

Commit

Permalink
Fix logging in test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvanoosten committed Jan 12, 2025
1 parent afc01ee commit 442c970
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,10 @@ object ConsumerSpec extends ZIOSpecDefaultSlf4j with KafkaRandom {
c1Diagnostics = new Diagnostics {
override def emit(event: => DiagnosticEvent): UIO[Unit] = event match {
case r: DiagnosticEvent.Rebalance if r.assigned.size == 1 =>
Clock.instant.flatMap(rebalanceEndTimePromise.succeed).unit
ZIO.logDebug(s"Rebalance finished: $r") *>
Clock.instant.flatMap(rebalanceEndTimePromise.succeed).unit
case r: DiagnosticEvent.Rebalance =>
ZIO.logDebug(s"Rebalance finished: $r")
case _ => ZIO.unit
}
}
Expand Down Expand Up @@ -997,7 +1000,7 @@ object ConsumerSpec extends ZIOSpecDefaultSlf4j with KafkaRandom {
.truncatedTo(ChronoUnit.SECONDS)
.getSeconds
.toInt
_ <- ZIO.logError(s"Rebalance took $rebalanceDuration seconds")
_ <- ZIO.logDebug(s"Rebalance took $rebalanceDuration seconds")
} yield assertTrue(rebalanceDuration <= 2)
},
test("partitions for topic doesn't fail if doesn't exist") {
Expand Down

0 comments on commit 442c970

Please sign in to comment.