Skip to content

Run all cases of 05448_dictionary_clickhouse_source_update_field_time_zone in one dictionary update - #129298

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:speed-up-05448-dictionary-update-field-test
Nov 5, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:speed-up-05448-dictionary-update-field-test

Conversation

@groeneai

@groeneai groeneai commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #127765

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 test 05448_dictionary_clickhouse_source_update_field_time_zone now runs in about 5 seconds instead of about 49.

Description

Asked for in #127765 (comment): the test took about 49 s in every lane and was the slowest one in Fast test (arm_darwin).

It ran ten incremental-update cases one after another, each waiting for the next periodic check of the dictionary loader (every 5 s). SYSTEM RELOAD DICTIONARY cannot replace that wait: a forced reload is a full load and never uses the update_field bound.

Now all ten dictionaries and their source tables are created up front and share one round of updates. The cases, the rows and the .reference are unchanged.

Validation on a debug build with the server in Europe/Amsterdam: 4.9 s instead of 49.9 s (median of 20 new and 3 old runs, new max 5.3 s), and 50 passes with random settings at -j 8. With each earlier state of the #127765 bound restored, the old and the new test print the same output, so every case still fails without its part of that fix.

🤖 Generated with Claude Code


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

Version info

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

…_zone in one dictionary update

The test waited for ten incremental dictionary updates one after another, and the
dictionary loader checks for updates only every 5 seconds, so it took about 49 s.
All ten dictionaries are now created up front and share one round of updates; the
reference is unchanged.

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

groeneai commented Nov 4, 2026

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; one full pass over the test, its reference, the old script and the dictionary update path).

# Sev Finding Verdict Evidence / action
1 💡 Changelog entry and one Description sentence were imprecise (own review) AGREE, fixed in the PR description the entry names the change; "the cases, the rows and the .reference are unchanged"

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-11:20261104-143600

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The old script takes 47-50 s on every run (9 of 9, five binaries): it is phase-locked to the loader's 5 s periodic check. Each broken binary below fails the new script on every run.
b Root cause explained? The ten incremental-update cases ran one after another, and each waited for the next periodic check of ExternalLoader::PeriodicUpdater (check_period_sec = 5). SYSTEM RELOAD DICTIONARY is a forced full load and never uses the update_field bound, so it cannot replace the wait.
c Fix matches root cause? Yes. All ten dictionaries and their source tables are created up front and share one round of updates. No sleep, tag, timeout or setting change, and no case is dropped.
d Test intent preserved / new tests added? Yes. The .reference is byte-identical. With each earlier state of the #127765 bound restored (local text, unpadded timestamp, String-only check, Dynamic% check), the old and the new script print the same output, and every case fails on at least one of them.
e Both directions demonstrated? Yes. The new script fails on all four broken binaries and passes on master. Time on master: 49.9 s before, 4.9 s after (medians; new max 5.3 s over 20 runs with random settings).
f Fix is general across code paths? N/A for src/ (test-only). Both source forms, TABLE and QUERY ... {condition}, are kept.
g Fix generalizes across inputs (params/datatypes/wrappers)? All five cases are kept: DateTime('Europe/Amsterdam') with the bound in the repeated DST hour, an 8-digit bound, String, Dynamic, SimpleAggregateFunction(anyLast, Dynamic). 70 runs with random settings (50 at -j 8) and 10 without: 0 failures.
h Backward compatible? (maintainer-approved exception only) N/A, test-only.
i Invariants and contracts preserved? Every dictionary finishes its initial full load before the new rows exist, a table's three rows arrive in one INSERT, results are read after the update that saw the far-future key, and the bound drifts by seconds (measured 1 s) against row margins of 1200 s.

Session id: cron:clickhouse-impl-slot-41:20261104-140200

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

cc @nihalzp, could you review this and add the can be tested label so CI runs? It is test-only: the ten incremental-update cases of 05448_dictionary_clickhouse_source_update_field_time_zone now share one round of dictionary updates instead of each waiting for its own 5 s loader check, so the test takes about 5 s instead of about 49 s with the same output.

@clickhouse-gh

clickhouse-gh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a657bc0]

Summary: ✅


AI Review

Summary

This test-only PR runs the ten existing incremental dictionary-update cases together, removing sequential loader waits while retaining their inputs and expected output. Reviewed head a657bc06053d06ce70a9bc3404fdd01a263b213d: no actionable findings. The changed test passed in 2.68 seconds in Fast test.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-testing Test content only (no production code). labels Nov 4, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 5, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ClickHouse:master with commit 06dbd3d Nov 5, 2026
185 of 186 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 5, 2026
@Algunenano

Copy link
Copy Markdown
Member

@groeneai The new tests takes 46 seconds (https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129409&sha=latest&name_0=PR&name_1=Fast+test+%28arm_darwin%29) so it shouldn't be on fast test. Please make it shorter or tag it. Also, think of a check to prevent these kinds of tests being accepted in fast tests. New tests that take more than 15 seconds should be prevented from being added to fast tests. If they are no-parallel then reduce the limit to half that (7.5 seconds). Don't modify old tests for now, only verify new tests for now. Reuse an existing check if possible (maybe in the same fast test check?)

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

The 46 s run on #129409 is from a workflow started at 2026-11-05 00:17 UTC, before this PR merged (02:28 UTC), so it still ran the old 05448_dictionary_clickhouse_source_update_field_time_zone. With this PR it takes about 4 s: since 2026-11-06 00:00 UTC, 0 of 298 Fast test runs (amd and arm_darwin) went over 15 s, median 4.2 s.

Acknowledged on the check. I'm working on making the Fast test job fail when a test added by the PR runs longer than 15 s (7.5 s if it is no-parallel), without checking existing tests. I'll follow up here with the PR.

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

The check is in #129716: the Fast test job now fails a test added by the PR (GitHub status added or copied) that runs longer than 15 s, or 7.5 s if it is no-parallel. Existing tests are not checked.

huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Nov 6, 2026
A test added by a PR now fails the Fast test when it runs longer than 15 s,
or 7.5 s when it is tagged `no-parallel` (or `sequential`). Existing tests
are not checked.

The Config Workflow hook `store_data.py` stores, for a PR, the files under
`tests/queries/0_stateless/` that GitHub reports as `added` or `copied` as
the KV key `new_stateless_test_files`. A renamed test is an old test, so it
is not included. `fast_test.py` marks an `OK` row of such a test as `FAIL`
when its duration is over the limit, reusing
`Targeting.functional_test_source_file` and
`Targeting.is_sequential_functional_test` from `find_tests.py`. The parent
`Tests` result goes from `OK` to `FAIL`; an `ERROR` or `FAIL` is kept. The
merge queue and master runs store no key, so they are not checked.

`find_tests.py` is not added to the Fast test digest: a PR that adds or
copies a test file always changes the digest, so the job always runs.

Requested in ClickHouse#129298 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129409&sha=latest&name_0=PR&name_1=Fast+test+%28arm_darwin%29
PR: ClickHouse#129409

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-dictionary Dictionaries (in-memory key-value, periodically refreshed from sources). 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-dictionary Dictionaries (in-memory key-value, periodically refreshed from sources). 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