Skip to content

AAD test coverage#46568

Draft
dibahlfi wants to merge 30 commits into
mainfrom
users/dibahl/aad-test-coverage
Draft

AAD test coverage#46568
dibahlfi wants to merge 30 commits into
mainfrom
users/dibahl/aad-test-coverage

Conversation

@dibahlfi
Copy link
Copy Markdown
Member

@dibahlfi dibahlfi commented Apr 28, 2026

This PR attempts to enhance the test coverage to include Data-plane user-data operations. It doesn't not cover ARM control plane or Data-plane resource management operations.
Currently there are 2 known gaps in the AAD workflow-
Known Issue — 403/5302 right after creating a new container under AAD - service side - there is a follow up going on.
403/5300 After Token Expiry - need to follow up with the client to see if they doing any custom work on Token Credential and have them provide more information if it happens next time - there is a separate thread around this.
Please note for now I have annotated the all the AAD tests with skip notation except one to ensure pipeline set up is correct. will enable all tests once this is confirmed.

@dibahlfi
Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread sdk/cosmos/aad.tests.yml Outdated
Comment thread sdk/cosmos/live-platform-matrix-aad.json Outdated
@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dibahlfi
Copy link
Copy Markdown
Member Author

dibahlfi commented May 7, 2026

@sdkReviewAgent-2

Comment thread sdk/cosmos/azure-cosmos/tests/test_change_feed.py Outdated
Comment thread sdk/cosmos/azure-cosmos/tests/test_aad.py
else:
print("Waiting for split to complete")
time.sleep(SLEEP_TIME)
await asyncio.sleep(SLEEP_TIME)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💬 Observation — Good Bug Fix: time.sleepawait asyncio.sleep

await asyncio.sleep(SLEEP_TIME)

This fixes a real pre-existing bug. The old time.sleep(SLEEP_TIME) was inside an async def trigger_split_async() method, blocking the entire asyncio event loop for 30 seconds per iteration. This prevented any concurrent async operations from running during the split wait loop. The fix to await asyncio.sleep() correctly yields control back to the event loop.

👍 Nice catch.

⚠️ AI-generated review — may be incorrect. Agree? → resolve the conversation. Disagree? → reply with your reasoning.

Comment thread sdk/cosmos/azure-cosmos/tests/test_semantic_reranker_async.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_change_feed_async.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_change_feed.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_change_feed_async.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_config.py
@xinlian12
Copy link
Copy Markdown
Member

Review complete (51:20)

Posted 15 inline comment(s).

Steps: ✓ context, correctness, cross-sdk, design, history, past-prs, synthesis, test-coverage

@dibahlfi
Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).


@pytest.mark.semanticReranker
@pytest.mark.cosmosAADLong
@pytest.mark.skipif(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why would we want to skip ? Shouldn't we fail if the test isn't setup correctly

Copy link
Copy Markdown
Member

@simorenoh simorenoh May 13, 2026

Choose a reason for hiding this comment

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

either way we are currently skipping all the semanticReranker tests (we don't have that configured for any run) since it relies on a separate service - though with that in mind, do we need this skip flag at all Dikshi?

Copy link
Copy Markdown
Member Author

@dibahlfi dibahlfi May 15, 2026

Choose a reason for hiding this comment

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

Good point — I removed the skipif as its dead weight anwyay since semantic reranker infra isnt there, I’ll keep these tests under the semanticReranker marker for now.

Comment thread sdk/cosmos/azure-cosmos/tests/test_per_partition_circuit_breaker_sm_mrr.py Outdated
Comment thread sdk/cosmos/azure-cosmos/tests/test_transactional_batch_async.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_crud_database.py Outdated
@xinlian12
Copy link
Copy Markdown
Member

Review complete (51:44)

Posted 4 inline comment(s).

Steps: ✓ context, correctness, cross-sdk, design, history, past-prs, synthesis, test-coverage

@dibahlfi
Copy link
Copy Markdown
Member Author

@sdkReviewAgent-2

Comment thread sdk/cosmos/azure-cosmos/tests/test_aad_async.py
Comment thread sdk/cosmos/azure-cosmos/tests/test_effective_preferred_locations.py
@xinlian12
Copy link
Copy Markdown
Member

Review complete (45:54)

Posted 2 inline comment(s).

Steps: ✓ context, correctness, cross-sdk, design, history, past-prs, synthesis, test-coverage

@dibahlfi
Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dibahlfi
Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants