Skip to content

Fail the Fast test when a test the PR adds takes more than 15 s (7.5 s for no-parallel) - #129716

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fast-test-new-test-time-limit
Nov 6, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fast-test-new-test-time-limit

Conversation

@groeneai

@groeneai groeneai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129298

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 Fast test now fails when a test added by the PR runs longer than 15 seconds, or 7.5 seconds if it is tagged no-parallel.

Description

Asked for in #129298 (comment), after 05448_dictionary_clickhouse_source_update_field_time_zone took 46 s in Fast test (arm_darwin) (#129298 has since brought it to about 4 s): nothing stopped a PR from adding a slow test to the Fast test. 05452_cancel_by_client_stops_sleep, added by #127149, takes about 17 s in both Fast test and Fast test (arm_darwin).

The check is in the Fast test job itself. The Config Workflow hook store_data.py records the test files the PR adds (GitHub status added or copied; a renamed test is an old test) in a new KV key, new_stateless_test_files. After the results are parsed, fast_test.py marks such a test FAIL when it ran longer than 15 s, or 7.5 s when it is tagged no-parallel (or sequential), with New test runs too long (> 15s). Make it faster or tag it `no-fasttest`. It reuses the tag and name helpers of find_tests.py. Existing tests are not checked, and neither are merge queue and master runs. Like any Fast test failure, it skips the builds and tests of that PR run. A new test close to the limit can fail its own PR on a slow run.

Validation, without a committed test (CI scripts): I ran throwaway tests through clickhouse-test with the Fast test flags and parsed the real output with FTResultsProcessor. New tests of 16 s, 18 s (.sql) and 8 s (no-parallel) fail. New tests of 12 s and 6 s (no-parallel) and an old 16 s test pass. Everything passes when the PR adds no test or only a .reference. On the real file lists of #127765 and #127149 the key holds exactly the added 05448 and 05452 files, not the tests those PRs modified.

🤖 Generated with Claude Code


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

Version info

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

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]>
@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand): 0 blockers, 0 majors, 2 nits noted

Gate B (cold, independent model) on 988fff653cd: 0 findings. Own review: 3 nits, none blocking.

Finding Verdict
💡 A sequential-tagged test over 7.5 s is reported as "New no-parallel test" (no test uses sequential today) noted, not blocking
💡 When only this check fails the run, its rows are not sorted to the top and the first info line still says Failed: 0; the second line names the slow tests noted, not blocking

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes: throwaway tests (new 16 s, 18 s .sql, 8 s no-parallel; new 12 s, 6 s no-parallel; old 16 s) run through clickhouse-test with the Fast test flags, real output parsed by FTResultsProcessor; same verdict on every parse.
b Root cause explained? The Fast test had no duration verdict and no notion of which tests a PR added: the CI KV data carried only changed_files, without GitHub's per-file status.
c Fix matches root cause? Yes: store_data.py stores the added/copied suite-root test files, and the Fast test job judges their parsed durations (15 s, 7.5 s for no-parallel/sequential).
d Test intent preserved / new tests added? CI-script change: no committed test (test-infrastructure rule); validated locally on real runner output and real GitHub file lists.
e Both directions demonstrated? Yes: on the same runner output the job is FAIL with the key and OK without it (no key = the previous behaviour).
f Fix is general across code paths? Both jobs that run fast_test.py (Fast test, Fast test (arm_darwin)); no other job reads the key; merge queue and master store none.
g Fix generalizes across inputs (params/datatypes/wrappers)? .sh/.sql/.sql.j2 names, parallel vs no-parallel, added/copied vs renamed/modified/removed/subdirectory files, .reference-only additions, exactly 15.00 s (passes), absent or empty key.
h Backward compatible? (maintainer-approved exception only) Yes: no setting or server change; a PR that adds no test sees no difference.
i Invariants and contracts preserved? Only OK rows are relabelled; a parent ERROR or FAIL keeps its status; the job status aggregation is unchanged.

Session id: cron:clickhouse-impl-slot-7:20261106-114600

@groeneai

groeneai commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @maxknv, could you review this and add the can be tested label so CI runs? The Config Workflow hook stores the test files the PR adds (added/copied) as new_stateless_test_files, and fast_test.py marks such a test FAIL when it ran longer than 15 s, or 7.5 s if it is no-parallel.

@clickhouse-gh

clickhouse-gh Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [988fff6]

Summary: ✅


AI Review

Summary

Reviewed #129716 at 988fff653cd1, including all prior discussion and both changed files. The change rejects newly added or copied stateless tests exceeding 15 seconds in Fast test, or 7.5 seconds when tagged no-parallel or sequential. Focused validation passed for file-status selection, threshold boundaries, generated template names, existing-test exclusion, and preservation of failure and error statuses. No actionable findings.

Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 6, 2026
@Algunenano Algunenano self-assigned this Nov 6, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label Nov 6, 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.

I love this

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Nov 6, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 6, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 6, 2026
Merged via the queue into ClickHouse:master with commit fa154b8 Nov 6, 2026
367 of 368 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 6, 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-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). 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