[Internal] Tests: Refactors GatewayTests to use async/await instead of sync-over-async#5772
Open
[Internal] Tests: Refactors GatewayTests to use async/await instead of sync-over-async#5772
Conversation
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
…-async Agent-Logs-Url: https://github.com/Azure/azure-cosmos-dotnet-v3/sessions/379d90d3-550e-46e2-a6a2-abc3dfed34e5 Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
…to return response.Resource Agent-Logs-Url: https://github.com/Azure/azure-cosmos-dotnet-v3/sessions/379d90d3-550e-46e2-a6a2-abc3dfed34e5 Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
Copilot
AI
changed the title
[WIP] Refactor GatewayTests to use async/await instead of sync-over-async
[Internal] Tests: Refactors GatewayTests to use async/await instead of sync-over-async
Apr 10, 2026
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
kirankumarkolli
approved these changes
Apr 11, 2026
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
|
Azure Pipelines: 1 pipeline(s) require an authorized user to comment /azp run to run. |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GatewayTests.cscontained 81 sync-over-async anti-patterns (.Result/.Wait()) across 16+ methods, risking deadlocks and masking exceptions viaAggregateExceptionwrapping.Changes
New async infrastructure
RetryAsync(Func<Task>)overload alongside existingRetry(Action)to support async retry lambdasHelper methods → async
CreateDocument(staticDocument)async Task<Document>CreateExecuteAndDeleteProcedure(withoutparam)CreateExecuteAndDeleteProcedureCoreAsyncreturning tuple (async can't haveoutparams)CreateExecuteAndDeleteCosmosProcedureCreateExecuteAndDeleteCosmosProcedureAsyncGetStoredProcedureExecutionResultGetStoredProcedureExecutionResultAsyncvoid test methods →
async TaskValidateTriggerCrud+ its two[TestMethod]callersValidateUserDefinedFunctionCrud+ its two[TestMethod]callersValidateUserDefinedFunctionTimeout,ValidateTriggersNameBasedAlready-async methods:
.Result/.Wait()→awaitValidateStoredProcedureCrudAsync,ValidateTriggersInternal,ValidateSystemSprocInternal,ValidateStoredProceduresBlacklistingInternal,ValidateUserDefinedFunctions,ValidateStoredProcedureExecutionWithPartitionKey,ValidatePOCODocumentSerialization,ValidateCollectionQuotaTestsWithFailureException handling fixed
Catch blocks that accessed
AggregateException.InnerException(artifact of.Wait()/.Result) converted to catch the underlyingDocumentClientExceptiondirectly:Collateral change
LinqGeneralBaselineTests.cs: updated caller of the renamedCreateExecuteAndDeleteCosmosProceduretoawait GatewayTests.CreateExecuteAndDeleteCosmosProcedureAsync<int>(...).