Skip to content

Rerun the tests master changed since the PR CI in the merge queue - #126406

Merged
alexey-milovidov merged 1 commit into
masterfrom
mq-flaky-check-master-drift
Oct 19, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
mq-flaky-check-master-drift

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Related: #124131
Related: #124507
Related: #126396
Related: #126397

The merge-queue flaky check reruns only the PR's own new/changed tests against the merge-queue state. That catches a master change breaking the PR's tests, but not the reverse: the PR breaking a test that landed on master after the PR's last CI run. #124131 passed the merge queue and broke 05339_string_filters_during_scan_parquet_short_dictionary_values, added by #124507 three days after #124131's last CI run. 05339 is no-fasttest, and the flaky check reran only #124131's own tests.

Now the Config Workflow job of the merge queue (the only one with the commit history) also finds the tests changed on the first-parent history of the queue base after the PR head commit time (or after the merge base, if the PR has merged master since). The PR CI cannot have been based on an older master. These tests are added to the merge-queue flaky check. When there are more than 30, the ones whose names share more words with the names of the files changed by the PR come first, then the newest.

Checked on the merge-queue commit of #124131 (d64fd503b42e): the range has 819 tests (6.5 days of master); the selected 30 start with 05347_string_filters_during_scan_parquet_short_unique_dictionary_values, 05339_string_filters_during_scan_parquet_short_dictionary_values, followed by the other new Parquet tests. The computation takes a few seconds.

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):

...

🤖 Generated with Claude Code


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

Version info

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

The merge-queue flaky check reran only the PR's own new/changed tests. That
catches a `master` change breaking the PR's tests, but not the reverse: the PR
breaking a test that landed on `master` after the PR's last CI run. This is how
#124131 broke
`05339_string_filters_during_scan_parquet_short_dictionary_values` from
#124507 and was reverted by
#126396.

The `Config Workflow` job of the merge queue, which has the commit history, now
finds the tests changed on the first-parent history of the queue base after the
PR head commit time (or after the merge base, if the PR merged `master` since),
and stores them for the flaky check. When there are more than 30, the ones whose
names share more words with the names of the files changed by the PR come first.

For the merge-queue commit of #124131 (`d64fd503b42e`), the range has 819 tests,
and 05339 is selected second.

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

clickhouse-gh Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0a3b4bd]

Summary: ✅


AI Review

Summary

The PR adds up to 30 relevant tests changed on master to the merge-queue flaky check. Request changes: two reproduced selection gaps can skip tests whose updated behavior was never exercised by the PR CI.

Findings

⚠️ Majors

  • [P2] Commit timestamps do not identify the base tested by PR CI. ci/jobs/scripts/find_tests.py:598–603: GitHub creates queue commits before they land on master. PR #124507 landed at 2026-10-13T17:30:50Z, while its merge commit is dated 2026-10-13T16:46:34Z. A target PR tested against the preceding master during that interval misses those tests, but the timestamp cutoff treats them as already covered. A synthetic Git-history reproduction returned an empty selection because drift_base == queue_base; the same graph with a later commit timestamp selected the new test. Use the actual base SHA tested by PR CI, or a conservative ancestry-based bound, and verify a queue commit created before the target PR head but landed after its CI.

  • [P2] Test-data submodule changes disappear from drift selection. ci/jobs/scripts/find_tests.py:608–612: The pathspec excludes contrib/parquet-testing, although the shared helper maps it to 05359_parquet_testing_corpus. Updating corpus encodings can change coverage without changing expected query output or reference files. A source-only Parquet PR can then break the updated corpus while the guard skips it. A synthetic gitlink-only bump reproduced this: the helper found the owning test, but both drift and combined selections were empty. Include TEST_DATA_SUBMODULES in the diff pathspec and verify submodule-only drift.

Final Verdict

⚠️ Request changes. Correct the history boundary and include test-data submodule dependencies in drift selection; verify both reproduced cases after the fixes.

Comment thread ci/jobs/scripts/find_tests.py Resolved
Comment thread ci/jobs/scripts/find_tests.py Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 17, 2026
fm4v added a commit that referenced this pull request Oct 17, 2026
…argeted checks

The coverage selection cannot see a test until a `master` coverage run records it, so a test that landed on `master` after the PR's last CI run escapes it. The `Config Workflow` job of the merge queue (which unshallows the repository) now finds the stateless tests and integration test modules changed on the first-parent history of the queue base after the PR head commit time (or after the merge base, if the PR merged `master` since), keeps the 30 stateless and 10 integration ones whose names share most words with the files the PR changes, and stores them. Both merge-queue targeted checks add them to the selection as mandatory tests. The window and ranking follow #126406.

Replayed on the merge-queue commits of the two known cases: for #117198 the integration selection includes `test_storage_delta/test_writes_interop.py` and `test_storage_delta/test.py`; for #124131 the stateless selection includes `05339_string_filters_during_scan_parquet_short_dictionary_values`.

The merge-queue targeted jobs are no longer cached: their selection depends on the queue entry and the attempt, neither of which is in the digest.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok.

@alexey-milovidov alexey-milovidov self-assigned this Oct 18, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 18, 2026
Merged via the queue into master with commit 94f0883 Oct 19, 2026
178 checks passed
@alexey-milovidov
alexey-milovidov deleted the mq-flaky-check-master-drift branch October 19, 2026 07:27
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 19, 2026
fm4v added a commit that referenced this pull request Nov 1, 2026
The merge queue is meant to fail fast, so its targeted checks stop at 3
failed tests (`--max-failures 3` for `clickhouse-test`, `--maxfail` for
pytest, with the sequential integration phase getting what remains of the
limit and dropped once it is reached), do not rerun the failed integration
tests, and stop at 20 minutes from their start, the budget of the
merge-queue flaky check, instead of 30. Reaching the time limit stops the
tests without failing the job, as before.

The merge-queue flaky check keeps its 20-minute limit and 5 failures.

The changed stateless tests and those `master` changed after the PR's last
CI run run only in the merge-queue flaky check, which already reruns them
since #126406; the targeted
integration check reruns the integration test modules `master` changed.

Related: #123832
Related: #125292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants