test: improve SSE streaming test reliability in CI environment#60
Merged
OhYee merged 1 commit intofix-sandbox-ttl-secondsfrom Mar 3, 2026
Merged
test: improve SSE streaming test reliability in CI environment#60OhYee merged 1 commit intofix-sandbox-ttl-secondsfrom
OhYee merged 1 commit intofix-sandbox-ttl-secondsfrom
Conversation
…ng in CI Migrate test implementations to use astream(stream_mode="updates") instead of astream_events to resolve async generator cancellation issues in CI environments. Also switch from httpx.ASGITransport to real HTTP servers with uvicorn for proper SSE stream handling in tests, addressing flaky streaming behavior in Linux CI environments. 将测试实现从 astream_events 迁移到 astream(stream_mode="updates") 以解决 CI 环境中的异步生成器取消问题。同时从 httpx.ASGITransport 切换到使用 uvicorn 的真实 HTTP 服务器,以正确处理测试中的 SSE 流式传输,解决 Linux CI 环境中的不稳定流式行为。 Change-Id: I4e9f694a80e952a94e240f479bb40fef59c0d649 Signed-off-by: OhYee <oyohyee@oyohyee.com>
a4f4b6c to
61f18a4
Compare
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.
Add real HTTP server support for SSE streaming tests to address CancelledError issues with httpx.ASGITransport in CI environments. Update test fixtures to use uvicorn-based servers instead of ASGI transport for more reliable stream handling during integration tests.
The changes replace httpx.ASGITransport with actual HTTP servers using uvicorn for testing SSE streams, which resolves premature cancellation problems in CI environments where ASGI transport failed to properly handle streaming responses.
这些更改将 httpx.ASGITransport 替换为使用 uvicorn 的实际 HTTP 服务器来测试 SSE 流,
解决了 CI 环境中 ASGI 传输无法正确处理流式响应导致的提前取消问题。
Change-Id: Ie47a62015e7530b2fd7e027e47e440d2fb3ee453
Fix bugs
Bug detail
Pull request tasks
Update docs
Reason for update
Pull request tasks
Add contributor
Contributed content
Content detail
Others
Reason for update