Skip to content

Fix long test durations - #1868

Open
xavdid wants to merge 1 commit into
masterfrom
speed-up-tests-2
Open

Fix long test durations#1868
xavdid wants to merge 1 commit into
masterfrom
speed-up-tests-2

Conversation

@xavdid

@xavdid xavdid commented Aug 6, 2026

Copy link
Copy Markdown
Member

Why?

After #1853, I noticed tests got really slow both locally in CI.

Before:

image

After:

image

With this fix:

image

Claude traced it to the timeout value, which doesn't set a maximum amount of time to wait, but a minimum. So all affected tests were taking exactly 30 seconds instead of "up to":

30.01s teardown tests/test_integration.py::TestIntegration::test_measures_stripe_client_telemetry[trio]
30.01s teardown tests/test_integration.py::TestIntegration::test_passes_client_telemetry_when_enabled
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream[trio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_unretryable[asyncio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_success[trio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_retries[trio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_hits_proxy_through_default_http_client
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_retries[asyncio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_hits_proxy_through_custom_client
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_unretryable[trio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream_error[asyncio-aiohttp]
30.00s teardown tests/test_integration.py::TestIntegration::test_hits_api_base
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_success[asyncio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_success[asyncio-aiohttp]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream[asyncio-aiohttp]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream_error[trio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_measures_stripe_client_telemetry[asyncio]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_unretryable[asyncio-aiohttp]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream[asyncio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_httpx_stream_error[asyncio-httpx]
30.00s teardown tests/test_integration.py::TestIntegration::test_async_raw_request_retries[asyncio-aiohttp]
0.71s call     tests/test_exports.py::test_can_import_namespaced_resource
0.67s call     tests/test_exports.py::test_can_import_deeply_namespaced_service
0.66s call     tests/test_exports.py::test_can_import_namespaced_service
0.52s call     tests/test_integration.py::TestIntegration::test_async_raw_request_retries[trio-httpx]
0.52s call     tests/test_integration.py::TestIntegration::test_async_raw_request_retries[asyncio-httpx]
...

I don't think this will reintroduce the flakiness (claude says the fix for that was defaulting to HTTP/1.1) but I'm also not super sure.

What?

  • reduced the timeout of our test handler

@xavdid
xavdid requested a review from a team as a code owner August 6, 2026 22:53
@xavdid
xavdid requested review from jar-stripe and removed request for a team August 6, 2026 22:53
@xavdid xavdid changed the title reduce timeout Fix long test durations Aug 6, 2026
@xavdid
xavdid enabled auto-merge (squash) August 6, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant