Skip to content

Commit

Permalink
Replace Yield with Delay to not hammer the CPU (#6831)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonsmits authored Sep 1, 2023
1 parent 748bfd0 commit b22a6ab
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 @@ -85,7 +85,7 @@ static async Task PerformScenarios(RunDescriptor runDescriptor, ComponentRunner[
}
}

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

startTime = DateTime.UtcNow;
Expand All @@ -97,7 +97,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 b22a6ab

Please sign in to comment.