[Internal] Tests: Adds DoNotParallelize to DistributedTransaction E2E tests#5711
Merged
kirankumarkolli merged 1 commit intoMar 19, 2026
Merged
Conversation
… tests All 4 DistributedTransaction E2E tests share a TestInitialize that calls DeleteAllDatabasesAsync, causing resource contention when tests run concurrently on the emulator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kirankumarkolli
approved these changes
Mar 19, 2026
Meghana-Palaparthi
added a commit
that referenced
this pull request
Mar 24, 2026
…ing and adds DoNotParallelize
Two bugs in DistributedTransactionTests.cs:
1. Mock JSON used all-lowercase property names ('statuscode', 'substatuscode',
'resourcebody') that do not match the model's JsonPropertyName attributes
('statusCode', 'subStatusCode') or the manual TryGetProperty lookup
('resourceBody'). System.Text.Json deserialization is case-sensitive, so
StatusCode was always 0 causing all status-code assertions to fail.
2. Missing [DoNotParallelize] attribute. The TestInitialize calls TestInit()
which runs DeleteAllDatabasesAsync; without [DoNotParallelize] concurrent
test execution causes emulator resource contention (same fix as #5711 for
the predecessor class DistributedTransactionE2ETests).
Also removes stray 'git' text from an inline comment.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds
[DoNotParallelize]attribute toDistributedTransactionE2ETeststo prevent concurrent test execution contention on the emulator.Root Cause
All 4 tests share a
TestInitializethat creates a new container viaBaseCosmosClientHelper.TestInit()(which callsDeleteAllDatabasesAsync). Concurrent test execution caused resource contention on the emulator, resulting in consistent ~4% failure rate across all 4 tests.Tests Fixed (95.82% pass rate each — 16 failures each in 30 days)
ValidateConflictResponseReturnsErrorStatusValidateHappyPathRequestAndResponseValidateMixedOperationsRequestStructureValidateResponseDeserializesCorrectlyImpact