From 52fdb5743b3a9ae4d3b06ee8c005faca2e1cf0bf Mon Sep 17 00:00:00 2001 From: Mathias Ormstrup Bjerregaard Date: Thu, 5 Dec 2024 12:16:56 +0100 Subject: [PATCH] we are speed --- source/IntegrationTests/Behaviours/BehavioursTestBase.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/IntegrationTests/Behaviours/BehavioursTestBase.cs b/source/IntegrationTests/Behaviours/BehavioursTestBase.cs index 22d44f777..09a036412 100644 --- a/source/IntegrationTests/Behaviours/BehavioursTestBase.cs +++ b/source/IntegrationTests/Behaviours/BehavioursTestBase.cs @@ -362,16 +362,25 @@ protected async Task> WhenActorPeeksAllMessages(ActorNumber var timeoutAt = DateTime.UtcNow.AddMinutes(1); while (DateTime.UtcNow < timeoutAt) { + var thereWasNothingToPeek = true; foreach (var messageCategory in EnumerationType.GetAll()) { var peekResult = await WhenActorPeeksMessage(actorNumber, actorRole, documentFormat, messageCategory); if (peekResult is null) + { break; + } + thereWasNothingToPeek = false; peekResults.Add(peekResult); await WhenActorDequeuesMessage(peekResult.MessageId.Value, actorNumber, actorRole); } + + if (thereWasNothingToPeek) + { + break; + } } return peekResults;