Skip to content

[Internal] Tests: Adds DoNotParallelize to DistributedTransaction E2E tests#5711

Merged
kirankumarkolli merged 1 commit into
masterfrom
users/nalutripician/test-fix-distributed-transaction
Mar 19, 2026
Merged

[Internal] Tests: Adds DoNotParallelize to DistributedTransaction E2E tests#5711
kirankumarkolli merged 1 commit into
masterfrom
users/nalutripician/test-fix-distributed-transaction

Conversation

@NaluTripician
Copy link
Copy Markdown
Contributor

Summary

Adds [DoNotParallelize] attribute to DistributedTransactionE2ETests to prevent concurrent test execution contention on the emulator.

Root Cause

All 4 tests share a TestInitialize that creates a new container via BaseCosmosClientHelper.TestInit() (which calls DeleteAllDatabasesAsync). 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)

  • ValidateConflictResponseReturnsErrorStatus
  • ValidateHappyPathRequestAndResponse
  • ValidateMixedOperationsRequestStructure
  • ValidateResponseDeserializesCorrectly

Impact

… 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 kirankumarkolli merged commit 0d28257 into master Mar 19, 2026
31 of 33 checks passed
@kirankumarkolli kirankumarkolli deleted the users/nalutripician/test-fix-distributed-transaction branch March 19, 2026 23:31
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants