[release/9.1] Add WaitBehavior to WaitForResourceHealthyAsync #7664
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #7650 to release/9.1
/cc @mitchdenny
Customer Impact
Currently the
WaitForResourceHealthyAsync
call will wait until the resource is healthy, but it does not allow the developer to stop waiting if the underlying resource fails to start - it means they need to rely on a timeout exception.This PR adds the behavior of throwing an exception (opt-in based on WaitBehavior enumeration). This is something that we have in the
WaitFor
API but never made its way to theWaitForResourceHealthyAsync
API.Testing
Unit tests added to cover this new overload with both enumeration cases tested.
Risk
Low. Existing behavior is preserved, this new feature is opt-in (although the code path did change for the existing behavior - but is covered extensively with existing test cases).
Regression?