diff --git a/core/src/main/scala/com/metamx/tranquility/tranquilizer/Tranquilizer.scala b/core/src/main/scala/com/metamx/tranquility/tranquilizer/Tranquilizer.scala index 541044b..a229a29 100644 --- a/core/src/main/scala/com/metamx/tranquility/tranquilizer/Tranquilizer.scala +++ b/core/src/main/scala/com/metamx/tranquility/tranquilizer/Tranquilizer.scala @@ -307,6 +307,11 @@ class Tranquilizer[MessageType] private( myBuffer.map(_ => Future.exception(new IllegalStateException("sendAll failed", e))) } + assert(myBuffer.nonEmpty) + // Check that all beams in the chain respect the contract. + // We can't be sure that they are still in the same order but at least we can check that a result exists for all messages sent + assert(myBuffer.size == futureResults.size) + val remaining = new AtomicInteger(futureResults.size) val sent = new AtomicInteger() val dropped = new AtomicInteger()