fixing key isolation - #48933
Open
Matthew Metcalf (mrm9084) wants to merge 6 commits into
Open
Conversation
Matthew Metcalf (mrm9084)
requested review from
Avani Gupta (avanigupta),
Jimmy Campbell (jimmyca15) and
Yuan Qu (yuanqu72)
as code owners
September 8, 2026 16:48
|
Azure Pipelines: Successfully started running 1 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 8, 2026 16:49
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Multi-resource setup occurs before cleanup protection, allowing partial setup failures to leak test data.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves App Configuration Provider test isolation through deterministic per-test keys and cleanup.
Changes:
- Uses dynamic keys for sync/async refresh tests.
- Deletes temporary settings and feature flags.
- Updates recorded test assets.
File summaries
| File | Description |
|---|---|
tests/test_provider_refresh.py |
Isolates synchronous refresh resources. |
tests/aio/test_async_provider_refresh.py |
Isolates asynchronous refresh resources. |
tests/key_vault/test_secret_refresh.py |
Uses a unique secret-reference key. |
tests/aio/key_vault/test_async_secret_refresh.py |
Adds async secret-key isolation. |
assets.json |
Updates the test recording asset tag. |
Review details
Suppressed comments (2)
sdk/appconfiguration/azure-appconfiguration-provider/tests/test_provider_refresh.py:108
- Both setup writes occur before this
try, so failure while creating the watch key bypasses cleanup and leaks the already-created refresh setting. Include resource creation in the protected region and tolerate partially completed setup during cleanup.
try:
sdk/appconfiguration/azure-appconfiguration-provider/tests/aio/test_async_provider_refresh.py:120
- The two resources are created before entering this
try. A failure creating the watch key therefore leaves the refresh setting behind, undermining the intended test isolation. Protect setup too and tolerate absent resources in cleanup.
try:
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 8, 2026 17:32
View session
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 8, 2026 18:57
View session
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 8, 2026 19:37
View session
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 8, 2026 21:02
View session
Copilot started reviewing on behalf of
Matthew Metcalf (mrm9084)
September 9, 2026 18:45
View session
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.
This pull request improves the reliability and maintainability of the App Configuration Provider test suite by making the test data more robust and reducing hard-coded values. The changes focus on dynamically generating resource names for test keys, cleaning up test data after execution, and updating test logic to use these dynamic keys. This helps prevent test conflicts and ensures a cleaner test environment.
Test improvements and reliability:
get_resource_name, reducing the risk of key collisions during parallel test runs. [1] [2] [3]finallyblocks, ensuring no leftover data affects other tests. [1] [2] [3]Test logic and import adjustments:
SettingSelectorandFeatureFlagConfigurationSetting. [1] [2] [3] [4]Test asset tracking:
assets.jsonto reflect the new state of the test assets.Description
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines