Skip to content

Commit b22a6ab

Browse files
authored
Replace Yield with Delay to not hammer the CPU (#6831)
1 parent 748bfd0 commit b22a6ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static async Task PerformScenarios(RunDescriptor runDescriptor, ComponentRunner[
8585
}
8686
}
8787

88-
await Task.Yield();
88+
await Task.Delay(100).ConfigureAwait(false);
8989
}
9090

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

100-
await Task.Yield();
100+
await Task.Delay(100).ConfigureAwait(false);
101101
}
102102
}
103103
finally

0 commit comments

Comments
 (0)