Repository navigation
Fix flaky test_s3_table_functions_timeouts - #111506
Conversation
The test injects a 1200ms network delay and expects an S3 INSERT to time out and raise. It set no explicit S3 timeout, so raising relied on a default timeout being below 1200ms on the connection path actually taken. On a fresh connection the adaptive connect timeout (500ms first attempt, 1000ms on retries) trips reliably. But when the S3 request reuses a pooled keep-alive connection there is no fresh TCP connect, so the connect timeout does not apply; the only remaining gate is the send/receive idleness timeout, whose default (adaptive 3000ms / configured 30000ms) is far above 1200ms, so the write completes and pytest.raises sees no exception. That is the rare DID NOT RAISE flake (one occurrence in 40 days of CI, zero on master). Make the request timeout the single failure mechanism: disable adaptive timeouts, keep the connect timeout above the delay, and set s3_request_timeout_ms=500. The send/receive idleness timeout applies to every attempt on both fresh and reused connections, so the 1200ms delay always exceeds it and the write times out deterministically. Also assert the raised error is a timeout, so the test cannot pass on an unrelated error.
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-0:20260723-001054 |
Internal second-model review (click to expand)An independent model reviewed the diff before submission. One finding, adjudicated:
|
|
cc @scanhex12 - could you review? Test-only fix for flaky |
|
Workflow [PR], commit [bf0f909] Summary: ✅ AI ReviewSummaryThis PR makes Final Verdict
|
…eouts-flaky-26.7 Backport #111506 to 26.7: Fix flaky test_s3_table_functions_timeouts
…ions-timeouts-flaky Fix flaky test_s3_table_functions_timeouts
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_s3_table_functions/test.py::test_s3_table_functions_timeoutsinjects a 1200ms network delay and expects an S3 INSERT to time out and raise. It set no explicit S3 timeout, so the raise relied on a default timeout being below 1200ms on the connection path actually taken:pytest.raisessees no exception. This is the rareDID NOT RAISEfailure reported on the report for Fix signed integer overflow in toStartOfSubsecondInterval when rounding near INT64_MIN #111370 (one occurrence in 40 days of CI, 0 on master).Fix: set
s3_request_timeout_ms=500for the timeout query. This idleness timeout applies to every attempt on both fresh and reused connections, so the 1200ms delay always exceeds it and the write times out deterministically. Test intent is preserved (a slow network still makes the write fail), and the change is confined to the timeout query settings.Validated: reproduced
DID NOT RAISEdeterministically by modeling the reused-connection path (no sub-1200ms timeout governing), confirmed the fix raises withs3_request_timeout_ms=500, and ran the modified test 5 times (--count 5 --random-order), all passing.Version info
26.8.1.39(included in26.8and later)