DocumentClient: Adds tests for PartitionKeyRangeLocation disposal#5778
Merged
kirankumarkolli merged 3 commits intoApr 13, 2026
Merged
Conversation
Adds unit tests covering the fix in PR #5777 where DocumentClient.Dispose() was missing disposal of PartitionKeyRangeLocation (GlobalPartitionEndpointManagerCore), causing the circuit breaker failback loop timer to leak. Tests added to GlobalPartitionEndpointManagerUnitTests: - Dispose_CancelsCancellationTokenSource: verifies cancellation after dispose - Dispose_IsIdempotent: multiple dispose calls are safe - Dispose_StopsBackgroundFailbackLoop: background loop stops after dispose - NoOp_DoesNotImplementIDisposable: confirms NoOp variant is not IDisposable New DocumentClientDisposeTests class: - Dispose_DisposesPartitionKeyRangeLocationWhenIDisposable - Dispose_HandlesNonDisposablePartitionKeyRangeLocation - Dispose_HandlesNullPartitionKeyRangeLocation - Dispose_IsIdempotentWithDisposablePartitionKeyRangeLocation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
kirankumarkolli
commented
Apr 12, 2026
kirankumarkolli
commented
Apr 12, 2026
kirankumarkolli
commented
Apr 12, 2026
kirankumarkolli
commented
Apr 12, 2026
kirankumarkolli
commented
Apr 12, 2026
- DocumentClient.cs: Replace 'is IDisposable' pattern with simple null check - Move Dispose_DisposesPartitionKeyRangeLocationWhenIDisposable test to GlobalPartitionEndpointManagerUnitTests - Remove Dispose_CancelsCancellationTokenSource, Dispose_IsIdempotent, and NoOp_DoesNotImplementIDisposable tests - Delete DocumentClientDisposeTests.cs (remaining tests undone) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
kirankumarkolli
commented
Apr 12, 2026
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
f363392 to
cd8b4cc
Compare
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
kirankumarkolli
commented
Apr 13, 2026
Member
Author
kirankumarkolli
left a comment
There was a problem hiding this comment.
LGTM, ready for review
1 task
This was referenced May 18, 2026
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.
Description
Adds unit tests covering the fix in PR #5777 where
DocumentClient.Dispose()was missing disposal ofPartitionKeyRangeLocation(GlobalPartitionEndpointManagerCore), causing the circuit breaker failback loop timer to leak.Tests added to
GlobalPartitionEndpointManagerUnitTests:GlobalPartitionEndpointManagerNoOpis notIDisposableNew
DocumentClientDisposeTestsclass:GlobalPartitionEndpointManagerNoOpdoesn't throwType of change