Skip to content

[azure-core/corehttp] Add JSONL and SSE streaming support - #48077

Open
Libba Lawrence (l0lawrence) wants to merge 19 commits into
Azure:feature/azure-core-streamingfrom
l0lawrence:l0lawrence-jsonl-stream-followup
Open

[azure-core/corehttp] Add JSONL and SSE streaming support#48077
Libba Lawrence (l0lawrence) wants to merge 19 commits into
Azure:feature/azure-core-streamingfrom
l0lawrence:l0lawrence-jsonl-stream-followup

[azure-core/corehttp] Fix streaming README to not import private deco…

ee0d040
Select commit
Loading
Failed to load commit list.
Azure Pipelines / python - cosmos - ci failed Aug 11, 2026 in 1h 1m 58s

Build #20260811.3 had test failures

Details

Tests

  • Failed: 2 (0.02%)
  • Passed: 11,288 (99.54%)
  • Other: 50 (0.44%)
  • Total: 11,340

Annotations

Check failure on line 61 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

Build log #L61

sdk/core/azure-core/azure/core/streaming/_sse.py:191:28 - Unknown word (WHATWG)

Check failure on line 62 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

Build log #L62

sdk/core/azure-core/azure/core/streaming/_sse.py:210:28 - Unknown word (WHATWG)

Check failure on line 63 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

Build log #L63

sdk/core/azure-core/tests/async_tests/test_stream_async.py:248:18 - Unknown word (𝜋this)

Check failure on line 64 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

Build log #L64

sdk/core/azure-core/tests/async_tests/test_stream_async.py:248:37 - Unknown word (message𝜋)

Check failure on line 1 in test_clear_cache_triggers_repopulation_async

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

test_clear_cache_triggers_repopulation_async

AssertionError: 1 != 0
Raw output
self = <test_shared_cache_integration_async.TestSharedCacheIntegrationAsync testMethod=test_clear_cache_triggers_repopulation_async>

    async def test_clear_cache_triggers_repopulation_async(self):
        """Async: After clear_cache(), the next routing-map fetch transparently re-populates."""
        await self._populate_cache(self.client1, self.container)
        cache = self._get_cache_dict(self.client1)
        self.assertTrue(len(cache) > 0)
    
        provider = self._get_routing_provider(self.client1)
        provider.clear_cache()
>       self.assertEqual(len(cache), 0)
E       AssertionError: 1 != 0

tests\test_shared_cache_integration_async.py:118: AssertionError

Check failure on line 1 in test_cross_region_retry[502]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / python - cosmos - ci

test_cross_region_retry[502]

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 0x00000235FA2FEF90>
setup = {'created_collection': <ContainerProxy [dbs/PythonSDKTestDatabase-de14ad86-45e1-43f4-8b1e-438c6bd7b12d/colls/test-timeout-retry-policy-container-f5d07966-93a4-414b-8086-e1e393ffe765]>}
error_code = 502

    @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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\core\tracing\decorator.py:119: in wrapper_use_tracer
    return func(*args, **kwargs)
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\cosmos\container.py:305: in read_item
    return self.client_connection.ReadItem(document_link=doc_link, options=request_options, **kwargs)
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\cosmos\_cosmos_client_connection.py:1536: in ReadItem
    return self.Read(path, http_constants.ResourceType.Document, document_id, None, options, **kwargs)
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\cosmos\_cosmos_client_connection.py:2980: in Read
    result, last_response_headers = self.__Get(path, request_params, headers, **kwargs)
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\cosmos\_cosmos_client_connection.py:3052: in __Get
    return synchronized_request.SynchronizedRequest(
..\..\..\.venv\azure-cosmos\.venv_whl\Lib\site-packages\azure\cosmos\_synchronized_request.py:321: in SynchronizedRequest
    return _retry_utility.Execute(
..\..\..\.venv\azure-cosmos\.venv_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.Mock
... [The stack trace has been truncated as it exceeded the maximum allowed size. Please refer to the complete log available in the Test Run attachments for full details.]