Skip to content

Commit

Permalink
Replace Yield with Delay to not hammer the CPU (#6831) (#6832)
Browse files Browse the repository at this point in the history
Co-authored-by: Ramon Smits <[email protected]>
  • Loading branch information
danielmarbach and ramonsmits authored Sep 1, 2023
1 parent 5c2ae26 commit f4b65d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static async Task PerformScenarios(RunDescriptor runDescriptor, ComponentRunner[
}
}

await Task.Yield();
await Task.Delay(100).ConfigureAwait(false);
}

startTime = DateTime.UtcNow;
Expand All @@ -103,7 +103,7 @@ static async Task PerformScenarios(RunDescriptor runDescriptor, ComponentRunner[
throw new Exception("Some failed messages were not handled by the recoverability feature.");
}

await Task.Yield();
await Task.Delay(100).ConfigureAwait(false);
}
}
finally
Expand Down

0 comments on commit f4b65d0

Please sign in to comment.