Skip to content

Fix Cosmos live and native test setup - #5379

Merged
Tomas Varon (tvaron3) merged 5 commits into
mainfrom
tvaron3-cosmos-test-fixes-pr
Sep 30, 2026
Merged

Tomas Varon (tvaron3) merged 5 commits into
mainfrom
tvaron3-cosmos-test-fixes-pr

Conversation

@tvaron3

@tvaron3 Tomas Varon (tvaron3) commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Fix test setup failures investigated in #5370 / weekly build 6895109 and subsequent live runs. No production behavior or ABI changes.

  • cosmos_aad.rs: apply a 30-second, 403/5302-only retry to the actual AAD query and full pager consumption, rather than a separate readiness probe. Preserve persistent RBAC failures and keep result assertions outside retries. Cover authorization, timeout, and partial-result handling with five deterministic regression tests.
  • cosmos_partition_merge.rs: provision 13,000 RU/s and assert multiple physical partitions instead of waiting for an unrelated split; retain merge, routing, and continuation assertions.
  • tests/framework/test_client.rs: recover from DNS outages observed in weekly builds 6897807 and 6903164 with a 30-second DNS-only retry window during client/database/container setup and resource cleanup. Preserve persistent errors, do not replay test bodies or fault-injected client construction, and retain the original test failure if cleanup also fails. Cover recovery boundaries, error precedence, and an in-memory SDK resource lifecycle with ten regression tests.

The original native topology mock fix is now supplied by upstream #5334 and is no longer part of this PR's diff.

Probe AAD query authorization with a bounded readiness check while preserving persistent failures. Provision multiple partitions directly for merge coverage instead of waiting for an unrelated split. Complete the native mock topology change-feed protocol for eager container resolution.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 80fad27f-9c2a-4450-9ec6-a983d6d479e6
@tvaron3

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label Sep 29, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tvaron3
Tomas Varon (tvaron3) marked this pull request as ready for review September 29, 2026 18:28
@tvaron3
Tomas Varon (tvaron3) requested a review from a team as a code owner September 29, 2026 18:28
Copilot AI balanced review requested due to automatic review settings September 29, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The test-only changes are consistent, bounded, and adequately covered by deterministic tests.

Review effort: Balanced
Findings: None

What changed in this PR

Improves Cosmos live and native test reliability without production or ABI changes.

Changes:

  • Adds bounded AAD query-authorization readiness retries and regression tests.
  • Provisions merge tests with multiple initial partitions.
  • Completes native mock partition-range responses with ETag/304 handling.
File Description
cosmos_partition_merge.rs Starts merge testing with multiple partitions.
cosmos_aad.rs Adds bounded query readiness handling and tests.
test_abi.rs Completes mocked topology resolution responses.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Recover from resolver outages during SDK test client and database setup without replaying test bodies or weakening assertions. Preserve the last DNS error after a 30-second recovery window and leave fault-injected client construction unchanged.

Cover resolver source classification, recovery, persistent errors, unrelated failures, and hanging retries with deterministic regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tvaron3

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Integrate native feed cursors from upstream e59c94c. Resolve the ABI fixture conflict using upstream's ETag-driven topology change feed, preserving the AAD, partition-merge, and DNS-recovery test fixes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tvaron3

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Remove the separate readiness probe, whose success cannot guarantee authorization of the subsequent query. Apply the existing bounded 403/5302 retry to query planning and pager consumption, leaving CRUD operations and result assertions outside the retry.

Add regression coverage that discards partial query results before retry so returned items are not duplicated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tvaron3

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Extend bounded DNS recovery to container setup and database cleanup. Preserve the original test failure when cleanup also fails, while continuing to fail otherwise successful tests on cleanup errors.

Exercise container creation and cleanup through the in-memory SDK with temporary DNS faults, and cover all test/cleanup error precedence combinations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tvaron3

Copy link
Copy Markdown
Member Author

/azp run rust - cosmos - weekly

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tvaron3
Tomas Varon (tvaron3) merged commit e23312b into main Sep 30, 2026
76 checks passed
@tvaron3
Tomas Varon (tvaron3) deleted the tvaron3-cosmos-test-fixes-pr branch September 30, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants