Make HttpLoggingPolicy log level configurable #44115
Open
Azure Pipelines / python - cosmos - ci
failed
Dec 2, 2025 in 52m 38s
Build #20251202.3 had test failures
Details
- Failed: 1 (0.02%)
- Passed: 4,879 (99.17%)
- Other: 40 (0.81%)
- Total: 4,920
Annotations
Check failure on line 3932 in Build log
azure-pipelines / python - cosmos - ci
Build log #L3932
PowerShell exited with code '1'.
Check failure on line 21 in Build log
azure-pipelines / python - cosmos - ci
Build log #L21
There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
Check failure on line 1 in test_cross_region_retry[503]
azure-pipelines / python - cosmos - ci
test_cross_region_retry[503]
AssertionError: assert 'https://127.0.0.1:8081/' == 'other-region'
- other-region
+ https://127.0.0.1:8081/
Raw output
self = <test_timeout_and_failover_retry_policy.TestTimeoutRetryPolicy object at 0x000002AAD4E0E140>
setup = {'created_collection': <ContainerProxy [dbs/PythonSDKTestDatabase-68b92164-3b01-49c5-aa7e-99fa656fa320/colls/test-timeout-retry-policy-container-694712c1-94de-4de6-8daa-fe13e418f378]>}
error_code = 503
@pytest.mark.parametrize("error_code", error_codes())
def test_cross_region_retry(self, setup, error_code):
mock_client = cosmos_client.CosmosClient(self.host, self.masterKey)
db = mock_client.get_database_client(self.TEST_DATABASE_ID)
container = db.get_container_client(self.TEST_CONTAINER_SINGLE_PARTITION_ID)
document_definition = {'id': 'failoverDoc' + str(uuid.uuid4()),
'pk': 'pk',
'name': 'sample document',
'key': 'value'}
created_document = container.create_item(body=document_definition)
self.original_execute_function = _retry_utility.ExecuteFunction
original_location_cache = mock_client.client_connection._global_endpoint_manager.location_cache
fake_endpoint = "other-region"
region_1 = "East US"
region_2 = "West US"
regional_routing_context = RegionalRoutingContext(self.host)
regional_routing_context_2 = RegionalRoutingContext(fake_endpoint)
original_location_cache.account_read_locations = [region_1, region_2]
original_location_cache.account_read_regional_routing_contexts_by_location = {region_1: regional_routing_context,
region_2: regional_routing_context_2
}
original_location_cache.read_regional_routing_contexts = [regional_routing_context, regional_routing_context_2]
try:
# should retry once and then succeed
mf = self.MockExecuteFunctionCrossRegion(self.original_execute_function, error_code, fake_endpoint)
_retry_utility.ExecuteFunction = mf
> container.read_item(item=created_document['id'],
partition_key=created_document['pk'])
tests\test_timeout_and_failover_retry_policy.py:144:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\whl\lib\site-packages\azure\core\tracing\decorator.py:119: in wrapper_use_tracer
return func(*args, **kwargs)
.tox\whl\lib\site-packages\azure\cosmos\container.py:300: in read_item
return self.client_connection.ReadItem(document_link=doc_link, options=request_options, **kwargs)
.tox\whl\lib\site-packages\azure\cosmos\_cosmos_client_connection.py:1498: in ReadItem
return self.Read(path, http_constants.ResourceType.Document, document_id, None, options, **kwargs)
.tox\whl\lib\site-packages\azure\cosmos\_cosmos_client_connection.py:2942: in Read
result, last_response_headers = self.__Get(path, request_params, headers, **kwargs)
.tox\whl\lib\site-packages\azure\cosmos\_cosmos_client_connection.py:3014: in __Get
return synchronized_request.SynchronizedRequest(
.tox\whl\lib\site-packages\azure\cosmos\_synchronized_request.py:286: in SynchronizedRequest
return _retry_utility.Execute(
.tox\whl\lib\site-packages\azure\cosmos\_retry_utility.py:138: in Execute
result = ExecuteFunction(function, global_endpoint_manager, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_timeout_and_failover_retry_policy.TestTimeoutRetryPolicy.MockExecuteFunctionCrossRegion object at 0x000002AAD009F640>
func = <function _Request at 0x000002AACD9168C0>
args = (<azure.cosmos._global_partition_endpoint_manager_per_partition_automatic_failover._GlobalPartitionEndpointManagerForP...ut-retry-policy-container-694712c1-94de-4de6-8daa-fe13e418f378/docs/failoverDoc08567123-b260-4ec6-810c-4af4033f9843/'>)
kwargs = {}
request_
Loading