Skip to content

Keep 02010_lc_native on the local disk and use the test timeout for its socket - #127034

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:lc-native-test-local-disk
Oct 21, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
groeneai:lc-native-test-local-disk

Conversation

@groeneai

@groeneai groeneai commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #126978
Related: #121512

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The 02010_lc_native test now keeps its table on the local disk and takes its socket timeout from the test timeout instead of a fixed 30 s.

Description

02010_lc_native failed in Stateless tests (arm_asan_ubsan, azure, parallel)
with TimeoutError: timed out while its valid insert awaited End of stream, 30 s after the python client
started (its s.settimeout(30)).

The server was not stuck, only late. On the azure lane the default MergeTree policy is a write-through
filesystem cache, and that one-row insert spent 34.07 s of its 34.43 s in
FilesystemCachePriorityWriteLockMicroseconds. End of stream went out 4.4 s after the client gave up. In
the same job, parts on that cache took up to 78 s, parts on the local default disk at most 60 ms.

Two changes, .reference untouched:

Validation: on a local write-through cache rig, a failpoint pausing cache eviction reproduces the CI
traceback 2/2 at 30.19 s with the old table and the insert passes 2/2 in 0.27 s with the new one. Against a
proxy delaying every server reply by 31 s, the old client times out at 30 s and the new one passes; with
CLICKHOUSE_TEST_TIMEOUT=10 it times out at 10 s. 50/50 randomized runs pass.


Workflow [PR]
Sync PR [sync-upstream/pr/127034]

Version info

  • Merged into: 26.11.1.459-master (included in 26.11 and later)

On the azure lane the default MergeTree storage policy is a write-through
filesystem cache. The test's valid native-protocol INSERT writes a one-row
part, and every file of that part reserves cache space under the cache's
priority write lock. In Stateless tests (arm_asan_ubsan, azure, parallel) on
PR ClickHouse#126978 that INSERT spent 34.07 s of 34.43 s waiting on the lock
(FilesystemCachePriorityWriteLockMicroseconds), so the server's correct End of
stream arrived 4.4 s after the python client's hard-coded 30 s socket timeout
and the test failed with TimeoutError in readStrict.

The storage is incidental to a native-protocol LowCardinality test, so pin
the table to storage_policy = 'default' (the local disk on every lane). The
part write stays MergeTree, the 30 s hang guard and the .reference are
unchanged. Same shape as ClickHouse#122567 (04344) and ClickHouse#126252 (04949) for this lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings;
bounded: 1 full pass + 1 fix round + 1 delta recheck).

No findings to adjudicate on this revision.

Session id: cron:clickhouse-review-slot-10:20261020-203300

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @CheSema, could you review this and add the can be tested label so CI runs? On the azure lane the valid insert of 02010_lc_native waited 34 s on the filesystem cache priority write lock, past the python client's 30 s socket timeout, so the test table now uses storage_policy = 'default'.

@clickhouse-gh

clickhouse-gh Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2d88050]

Summary: ✅


AI Review

Summary

PR #127034 keeps 02010_lc_native on local storage and derives all four socket timeouts from CLICKHOUSE_TEST_TIMEOUT, avoiding premature failures on slow server replies. Reviewed the full diff and current code at head 2d88050d14781a18acf2fe1519cb72d1232951a7, together with all prior discussion. No actionable findings.

Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-testing Test content only (no production code). labels Oct 20, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 21, 2026
@Algunenano Algunenano self-assigned this Oct 21, 2026

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@groeneai I think in general this is positive since it makes the test faster, but maybe we should increase the timeouts of the socket operation in Python (even if it's just this call) so it matches the tests timeout defaults

The python client hard-coded a 30 s socket timeout, while the harness gives
the test `CLICKHOUSE_TEST_TIMEOUT` seconds (600 by default), so a slow but
working server failed it. Take the socket timeout from that variable instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai changed the title Keep the table of 02010_lc_native on the local disk Keep 02010_lc_native on the local disk and use the test timeout for its socket Oct 21, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Done in 2d88050: all four socket timeouts in 02010_lc_native.python now come from CLICKHOUSE_TEST_TIMEOUT (the per-test budget clickhouse-test exports, 600 s by default) instead of 30 s, and the local-disk change stays. A real hang is now caught by the test timeout rather than a python TimeoutError; checked against a proxy that delays every server reply by 31 s, where the old client times out and the new one passes.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 21, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 21, 2026
Merged via the queue into ClickHouse:master with commit 4691c9e Oct 21, 2026
178 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 21, 2026
@clickhouse-gh clickhouse-gh Bot added comp-datatype-wrapper Type modifiers/wrappers (Nullable, LowCardinality, etc.). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-datatype-wrapper Type modifiers/wrappers (Nullable, LowCardinality, etc.). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants