From f4b65d0dd83e4b7607c41a7c93742c3a73052030 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Fri, 1 Sep 2023 10:37:05 +0000 Subject: [PATCH] Replace Yield with Delay to not hammer the CPU (#6831) (#6832) Co-authored-by: Ramon Smits --- src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs b/src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs index 4bb979c5380..953eba821a9 100644 --- a/src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs +++ b/src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs @@ -91,7 +91,7 @@ static async Task PerformScenarios(RunDescriptor runDescriptor, ComponentRunner[ } } - await Task.Yield(); + await Task.Delay(100).ConfigureAwait(false); } startTime = DateTime.UtcNow; @@ -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