Skip to content

Commit

Permalink
Replace Yield with Delay to not hammer the CPU (#6831) (#6833)
Browse files Browse the repository at this point in the history
Co-authored-by: Ramon Smits <ramon.smits@gmail.com>
  • Loading branch information
danielmarbach and ramonsmits authored Sep 1, 2023
1 parent f35f416 commit 1ef06e3
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 1ef06e3

Please sign in to comment.