Skip to content

Backport #111506 to 26.7: Fix flaky test_s3_table_functions_timeouts - #112589

Merged
clickhouse-gh[bot] merged 1 commit into
26.7from
fix/s3-table-functions-timeouts-flaky-26.7
Jul 30, 2026
Merged

clickhouse-gh[bot] merged 1 commit into
26.7from
fix/s3-table-functions-timeouts-flaky-26.7

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Backport of #111506 to the 26.7 release branch.

test_s3_table_functions/test.py::test_s3_table_functions_timeouts is flaky on 26.7: the test injects a 1200ms network delay and expects the S3 INSERT to time out, but when the request reuses a pooled keep-alive connection there is no fresh TCP connect, so the connect timeout does not apply and the write completes — DID NOT RAISE. The fix (already on master) makes s3_request_timeout_ms the single failure mechanism and asserts the error is a timeout.

The fix was never backported, so the flake still hits CI of 26.7 backport pull requests, e.g. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112365&sha=dd3a3d84d1e2b05319bf27d88dbefeeb1403ed1b&name_0=BackportPR&name_1=Integration%20tests%20%28amd_tsan%2C%203%2F6%29 (#112365).

Test-only change.

Related: #111506
Related: #112365

Changelog category (leave one):

  • CI Fix or improvement (changelog entry is not required)

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.

(cherry picked from commit bf0f909)
@clickhouse-gh

clickhouse-gh Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [af6c1d4]

Summary: ✅

@clickhouse-gh
clickhouse-gh Bot merged commit 4e1a4cc into 26.7 Jul 30, 2026
38 of 39 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the fix/s3-table-functions-timeouts-flaky-26.7 branch July 30, 2026 14:54
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.

2 participants