Skip to content

Commit

Permalink
More reliablility for scheduled test
Browse files Browse the repository at this point in the history
  • Loading branch information
andystaples committed Jan 29, 2025
1 parent 72968ea commit 1b684ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/Tests/Tests/HelloCitiesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ public async Task ScheduledStartTests(string functionName, int startDelaySeconds
// Give a small amount of time for the orchestration to complete, even if scheduled to run immediately
Thread.Sleep(3000);
WriteOutput($"Test scheduled for {scheduledStartTime}, current time {DateTime.Now}, looking for completed");

var finalOrchestrationDetails = DurableHelpers.GetRunningOrchestrationDetails(statusQueryGetUri);
int retryAttempts = 0;
while (finalOrchestrationDetails.RuntimeStatus != "Completed" && retryAttempts < 10)
{
Thread.Sleep(1000);
finalOrchestrationDetails = DurableHelpers.GetRunningOrchestrationDetails(statusQueryGetUri);
retryAttempts++;
}
Assert.Equal("Completed", finalOrchestrationDetails.RuntimeStatus);

Assert.True(finalOrchestrationDetails.LastUpdatedTime > scheduledStartTime);
Expand Down

0 comments on commit 1b684ce

Please sign in to comment.