[RuntimeAsync] make a test compatible with runtime async. #120701
+14
−4
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.
This is a test-only change.
The particular testcase looks into implementation details of active task tracking like
s_currentActiveTasks
Runtime async does not have task tracking on synchronous/fast path since no tasks are created, so assumption that as long as we have async code,
s_currentActiveTasks
will be initialized to something is no longer true.Test expects "fewer than 10 active tasks" at the end of the scenario.
I changed the test to handle a case if no active tasks were tracked at all. This keeps the test checking for the same thing - that not a lot of active tasks may hang around unexpectedly, but avoids a crash if
s_currentActiveTasks
isnull
.