Skip to content

Commit d82ba37

Browse files
CopilotYunchuWang
andcommitted
Add timeout checking logic back to LongRunningOrchestration
Added back the logic to check which task completed and throw TimeoutException if the timer completes first, as requested by code review. Co-authored-by: YunchuWang <[email protected]>
1 parent 3401f71 commit d82ba37

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/Grpc.IntegrationTests/GrpcDurableTaskClientIntegrationTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,12 @@ static async Task<string> LongRunningOrchestration(TaskOrchestrationContext cont
639639
// Wait for external event or a timer (30 seconds) to allow suspend/resume operations
640640
Task<string> eventTask = context.WaitForExternalEvent<string>("event");
641641
Task timerTask = context.CreateTimer(TimeSpan.FromSeconds(30), CancellationToken.None);
642-
await Task.WhenAny(eventTask, timerTask);
642+
Task completedTask = await Task.WhenAny(eventTask, timerTask);
643+
644+
if (completedTask == timerTask)
645+
{
646+
throw new TimeoutException("Timed out waiting for external event 'event'.");
647+
}
643648

644649
if (shouldThrow)
645650
{

0 commit comments

Comments
 (0)