Skip to content

Commit 6bd9b33

Browse files
committed
MessagesTests: allow postpone/suspended in BatchedMessages WaitForCompletion
The old hand-rolled QueueManager in this test used MessagesDefaultMaxWaitForCompletion = TimeSpan.FromMinutes(1), which made the in-memory wait long enough that the flow never actually suspended -- so its WaitForCompletion (defaulting to allowPostponeAndSuspended: false) was fine. After switching to workflow.Message<string>(), the framework's QueueManager runs with MaxWait = TimeSpan.Zero, so the flow does transition through Postponed (Expires=0 once AppendMessage's store-level Interrupt fires) before the watchdog re-invokes and the flow Succeeds. WaitForCompletion was polling during that brief Postponed window and throwing InvocationPostponedException. Matches the pattern already used by PingPong and MultipleMessages.
1 parent d146326 commit 6bd9b33

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Core/Cleipnir.ResilientFunctions.Tests/Messaging/TestTemplates/MessagesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ await registration.SendMessages(
256256
var controlPanel1 = await registration.ControlPanel("Instance#1").ShouldNotBeNullAsync();
257257
var controlPanel2 = await registration.ControlPanel("Instance#2").ShouldNotBeNullAsync();
258258

259-
await controlPanel1.WaitForCompletion(maxWait: TimeSpan.FromSeconds(2));
260-
await controlPanel2.WaitForCompletion(maxWait: TimeSpan.FromSeconds(2));
259+
await controlPanel1.WaitForCompletion(allowPostponeAndSuspended: true, maxWait: TimeSpan.FromSeconds(2));
260+
await controlPanel2.WaitForCompletion(allowPostponeAndSuspended: true, maxWait: TimeSpan.FromSeconds(2));
261261

262262
unhandledExceptionCatcher.ShouldNotHaveExceptions();
263263
}

0 commit comments

Comments
 (0)