Skip to content

Commit 9df19c3

Browse files
author
Jenda Kolena
committed
Making PoisonedMessageHandlerLiveTest more failure-prone
1 parent c609e02 commit 9df19c3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

core/src/test/scala/com/avast/clients/rabbitmq/PoisonedMessageHandlerLiveTest.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,13 @@ class PoisonedMessageHandlerLiveTest extends TestBase with ScalaFutures {
206206
// run async:
207207
ex.execute(() => {
208208
while (true) {
209-
val PullResult.Ok(dwh) = cons.pull().await
210-
processed.incrementAndGet()
211-
dwh.handle(DeliveryResult.Republish()).await
209+
cons.pull().await match {
210+
case PullResult.Ok(dwh) =>
211+
processed.incrementAndGet()
212+
dwh.handle(DeliveryResult.Republish()).await
213+
214+
case PullResult.EmptyQueue => // 🤷‍
215+
}
212216
}
213217
})
214218

@@ -318,7 +322,7 @@ class PoisonedMessageHandlerLiveTest extends TestBase with ScalaFutures {
318322
sender.send(initialRoutingKey, Bytes.copyFromUtf8(n.toString), Some(MessageProperties(messageId = Some(s"msg_${n}_")))).await
319323
}
320324

321-
eventually(timeout(Span(90, Seconds)), interval(Span(1, Seconds))) {
325+
eventually(timeout(Span(120, Seconds)), interval(Span(1, Seconds))) {
322326
println(s"PROCESSED COUNT: ${processed.get()}")
323327
// we can't assert the `processed` here - some deliveries may have been cancelled before they were even executed
324328
assertResult(0)(testHelper.queue.getMessagesCount(queueName1))

0 commit comments

Comments
 (0)