Skip to content

[CI test, do not merge] Validate unit-test bugfix validation job (reproduce path) - #108833

Closed
nickitat wants to merge 14 commits into
masterfrom
gtest-bugfix-check-stageb-reproduce
Closed

nickitat wants to merge 14 commits into
masterfrom
gtest-bugfix-check-stageb-reproduce

Conversation

@nickitat

@nickitat nickitat commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Do not merge — CI validation only.

Stacked on #108827 (the new Bugfix validation (unit tests) job) to exercise its
reproduce path on real CI.

The change is a synthetic bug fix: escapeForFileName is modified to keep .
verbatim instead of percent-encoding it, and src/Common/tests/gtest_bugfix_probe.cpp
asserts the new output (escapeForFileName("a.b") == "a.b").

Expected behaviour of the job:

  • The PR binary (with the fix) passes the touched BugfixProbe suite.
  • The merge-base "before" binary (without the fix, only the test overlaid) produces
    a%2Eb and fails the suite.
  • Therefore the job reports the bug as reproduced (XFAIL/OK).

Related: #108827

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Synthetic test PR — not for changelog. Keep . verbatim in escapeForFileName (CI validation only, do not merge).

nickitat and others added 2 commits June 29, 2026 16:20
Remove an extraneous `f` prefix from a `print` with no placeholders, flagged
by the diff-scoped `Style check/ruff` on PR #108827.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat nickitat added the pr-bugfix Pull request with bugfix, not backported by default label Jun 29, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [eeadd25]

Summary: ❌

job_name test_name status info comment
Docker keeper image FAIL
clickhouse/clickhouse-keeper:head-alpine-amd64 FAIL cidb
clickhouse/clickhouse-keeper:head-distroless-amd64 FAIL cidb
docker library image test (clickhouse/clickhouse-keeper:head-alpine-amd64) FAIL cidb
docker library image test (clickhouse/clickhouse-keeper:head-distroless-amd64) FAIL cidb
Stress test (amd_tsan) FAIL
Hung check failed, possible deadlock found FAIL cidb, issue
Stress test (arm_tsan) FAIL
Hung check failed, possible deadlock found FAIL cidb, issue
Upgrade check (amd_release) FAIL
Error message in clickhouse-server.log (see upgrade_error_messages.txt) FAIL cidb

AI Review

Summary

This PR adds a Bugfix validation (unit tests) CI job that builds a merge-base unit_tests_dbms with PR test files overlaid, then expects the touched gtest suites to fail before the fix. The direction is useful, but the current implementation can still skip real gtest registrations, report success after validating nothing, and build the "before" binary from inputs that are not strictly the merge-base state. The PR also carries a synthetic production change in escapeForFileName that must not be merged.

Findings

❌ Blockers

  • [src/Common/escapeForFileName.cpp:15] escapeForFileName is a reversible encoder used for metadata paths, ZooKeeper/Keeper metadata, cluster strings, and similar persisted or parsed components, but this sentinel branch maps a valid word-character input to a different string. For example, unescapeForFileName(escapeForFileName("__ch_bugfix_validation_probe__")) becomes bugfix-validation-ok, not the original input. A mergeable version must not change production encoding semantics for a CI probe. Suggested fix: remove the synthetic production branch before merge, or validate the CI job with a test-only fixture that cannot be reached by real callers and is not shipped.

⚠️ Majors

  • [ci/jobs/unit_tests_bugfix_validation_job.py:56] The suite extractor still misses the real GTEST_TEST registration macro, so bugfix PRs using that macro can be classified as having no runnable unit-test suite and the validator will not exercise their regression tests. Suggested fix: include GTEST_TEST in _GTEST_MACROS and add a focused extractor/filter test for it.
  • [ci/jobs/unit_tests_bugfix_validation_job.py:370] A bugfix PR that changes a src/**/tests/* file but has no suite recognized by this parser is reported as OK, even though the validator compiled and ran no touched regression test. That weakens the status contract of this new blocking job. Suggested fix: make this path inconclusive or failing for bugfix PRs, or move the skip decision into filter_job so a green validator status always means validation actually ran.
  • [ci/jobs/unit_tests_bugfix_validation_job.py:222] The before worktree is created at the merge base, but its contrib directories are hardlinked from the PR checkout. If a bugfix PR bumps a submodule, the "before" binary is no longer merge-base code plus only PR test files, so the validator can pass using dependency changes from the fix side. Suggested fix: populate submodules at the merge-base gitlinks, or fail closed when the PR changes .gitmodules or any submodule pointer.
  • [ci/jobs/unit_tests_bugfix_validation_job.py:133] Fetching the base ref is allowed to fail with ||:, then git merge-base HEAD origin/{base} uses whatever local origin/{base} happens to exist. On a stale or partially reused runner checkout, the validator can build against the wrong baseline and produce a false reproduction. Suggested fix: require the fetch to succeed, or use the merge_base_commit_sha captured by store_data.py and verify that exact commit is present before building.
Tests
  • ⚠️ The helper tests cover some parsing/filter cases, but they do not cover GTEST_TEST, no-suite changed files, failed/stale base fetches, or submodule-pointer changes. Add focused tests or a small orchestration harness for these status-model and input-selection paths.
Final Verdict

Status: ❌ Block

Minimum required actions: remove the synthetic escapeForFileName production change before any mergeable PR, then fix the validator paths that can skip or validate the wrong before-binary inputs.

@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog and removed pr-bugfix Pull request with bugfix, not backported by default labels Jun 29, 2026
BUILD_TYPE = BuildTypes.AMD_ASAN_UBSAN

# gtest test-registration macros whose first argument is the test-suite name.
_GTEST_MACROS = (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The suite extractor misses GTEST_TEST, which is a real GoogleTest registration macro already used in src/Core/tests/gtest_settings.cpp, src/Common/tests/gtest_weighted_random_sampling.cpp, src/DataTypes/tests/gtest_NestedUtils.cpp, and other unit_tests_dbms sources. A bugfix PR that adds a regression with GTEST_TEST will produce no suites here, hit the "No gtest test suites" OK path below, and still satisfy the unit-test shortcut in new_tests_check. Include GTEST_TEST and a regression in ci/tests/test_unit_tests_bugfix_validation.py so changed unit tests cannot be silently skipped.

@nickitat nickitat added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Jun 29, 2026
The job required the PR's `UNITTEST_AMD_ASAN_UBSAN` artifact only to run the
touched suites on the PR binary ("must pass"). Requiring it gated the job behind
`build_amd_asan_ubsan` and its whole pre-build chain (`fast_test`, `style_check`,
`build_arm_tidy`, `ci_tests`), and forced the in-job "before" build to run only
after the artifact arrived (serial `build + build`).

Drop the requirement and delegate the "touched tests pass on the PR binary" side
to the regular `Unit tests (asan_ubsan)` job, which already compiles and runs the
full suite — including the new test — on the PR binary (a broken regression test
makes that job red and blocks the PR). This mirrors how the functional/integration
bugfix validators only check the "before" side and rely on the normal test jobs
for the "after" side.

The job's `needs` is now `[config_workflow, dockers_*]`, identical to the FT/IT
validators, so it starts as early and builds the "before" binary in parallel with
the build matrix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from 6d2b5ae to d5ede1b Compare June 29, 2026 17:37
Comment thread src/Common/escapeForFileName.cpp Resolved
A run of the synthetic reproduce test (PR #108833) "passed" for the wrong reason,
which surfaced two bugs:

1. False positive (fail-close violation). The job treated ANY before-binary build
   failure as proof the test depends on the fix. The actual failure was a `cmake`
   configure abort ("Submodules are not initialized", CMakeLists.txt) — an
   infrastructure problem — yet the job reported success. Split the build into a
   `configure` step and a `compile` step: a configure failure is now reported as an
   `ERROR` (inconclusive), and only a genuine `ninja` compile failure of the overlaid
   test counts as the "test depends on the fix" XFAIL proof. Also assert the submodule
   marker is present in the before-worktree before building and fail close if not.

2. Submodules never populated. `needs_submodules=True` only restores the submodule
   git data (`.git/modules`) from the S3 cache; the working-tree files must still be
   checked out. The job relied on hardlinking `contrib/*` from the primary checkout,
   but those working trees were empty, so nothing was copied. Add
   `ensure_primary_submodules` (mirroring the CHECKOUT_SUBMODULES stage of
   `build_clickhouse.py`: cache fast-path + full-fetch fallback) before the hardlink.

CI report (false positive): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=d5ede1be358c25a9ce56dcedc147b3ec8efcf9ca&name_0=PR
PR: #108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from d5ede1b to 39e2415 Compare June 29, 2026 18:00
[
Result(
name="Bugfix validation (unit tests)",
status=Result.Status.OK,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changed unit-test files with no discoverable suite should be inconclusive/failing, not OK. A bugfix PR can put the regression assertions in a changed src/.../tests/*.h helper, or in any registration form this extractor does not understand; test_files is non-empty, but derive_test_suites returns empty, this branch completes the validator as success, and new_tests_check.has_new_unit_tests accepts the same changed file as proof. That lets the bugfix contract pass without ever building or running the before binary. Please fail close here, or require an explicit suite hint / other deterministic selection, whenever changed unit-test files exist but no suite can be selected.

/// caller ever passes, so existing behavior is completely unaffected; only the new
/// gtest observes it. Without this branch the merge-base returns the sentinel
/// unchanged, so the test fails there and passes here — a clean runtime reproduction.
if (s == "__ch_bugfix_validation_probe__")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

escapeForFileName is used as a reversible encoder for on-disk and Keeper path components, and callers can pass valid user names such as __ch_bugfix_validation_probe__. This branch makes unescapeForFileName(escapeForFileName("__ch_bugfix_validation_probe__")) return bugfix-validation-ok, so a database/table/column with that name can be persisted under one name and loaded or displayed as another. Even for a CI-validation PR, this code cannot land in master; keep the synthetic mutation out of the mergeable diff or put the probe behind a test-only helper instead.

…tions

Run of PR #108833 "reproduced" via an unrelated abort, exposing two issues:

1. Wrong run environment. The before-binary runs in the binary-builder container,
   whose default seccomp profile blocks `io_uring`. `unit_tests_dbms` links the `silk`
   fiber runtime, which calls `io_uring_queue_init_params` at startup and aborts
   (`SILK_ASSERT(!r)`) when it is denied — before any test runs. Add `--privileged` to
   this job's docker (matching how the regular `Unit tests` job runs the same binary
   in `clickhouse/test-base+--privileged`) so the before-binary can initialize.

2. Unattributable crash counted as reproduction. A before-binary failure was treated
   as "bug reproduced" even when the binary died before any touched test ran. Require a
   gtest `[ RUN ]` marker (`before_run_started_a_test`): a failure/crash counts as a
   reproduction only if the touched suite actually started (this still covers legitimate
   crash-bugs that die mid-test); otherwise report `ERROR`/inconclusive. Fail close.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=905cf4af0fc7af775eaff662fd500554efb96e2b&name_0=PR
PR: #108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from 905cf4a to ed315a9 Compare June 29, 2026 22:10
… sccache hits

The before-build compiled the worktree at its real path
`/ClickHouse/ci/tmp/before_src`, but sccache keys bake in the absolute build path (via
`-ffile-prefix-map=<root>/=` and preprocessed `# line` markers). Master's cache was
populated by builds at `/ClickHouse`, so every key missed: 0% hits, a full cold compile
(16201 TUs, ~57 min) vs ~11 min for the regular cached build.

Run cmake+ninja inside `unshare -m` with `mount --bind <before_src> /ClickHouse`, using
the UNMODIFIED canonical cmake flags. The compile commands and preprocessed output are
then byte-identical to the regular build at `/ClickHouse`, so they reuse master's
sccache entries. The bind is private to the build subprocess, so the real checkout and
this running script are untouched, and `/ClickHouse/build` in the namespace IS
`before_src/build` on disk, so BEFORE_BINARY is unchanged. Needs CAP_SYS_ADMIN, provided
by the `--privileged` already added for io_uring.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from ed315a9 to 09963e8 Compare June 30, 2026 11:10
…orks

The before-build's sccache fix uses `unshare -m` + `mount --bind`, which need
CAP_SYS_ADMIN. Jobs run as `--user $(id -u)` (non-root) by default, so `unshare`
failed with "Operation not permitted" (configure step failed in 4 ms; correctly
reported as ERROR/inconclusive by the fail-close path, not a false pass). Add the
`+root` token so the job drops `--user` and runs as root — combined with the existing
`--privileged`, that grants CAP_SYS_ADMIN. Mirrors other privileged jobs
(stateless-test, integration) which also use `+root`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=09963e897dc78a56052a37647d305e59111dcd4a&name_0=PR
PR: #108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from 09963e8 to f758451 Compare June 30, 2026 11:42
dst = os.path.join(BEFORE_SRC, path)
Shell.check(f"rm -rf '{dst}' && mkdir -p '{os.path.dirname(dst)}'", verbose=False)
# cp -al = recursive hardlink copy (instant, no data duplication).
Shell.check(f"cp -al '{path}' '{dst}'", verbose=False)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The validator promises that the before binary is built from the merge base plus only the PR's unit-test files, but this hardlinks contrib from the PR checkout into the merge-base worktree. If a bugfix PR bumps a submodule and adds a gtest for that fix, the before build uses the fixed submodule contents, so the touched test can pass there and the validator reports a false no-repro instead of testing the old code. Please either populate submodules in the before worktree at the merge-base gitlinks, or fail close when the PR changes a submodule pointer instead of reusing the PR checkout's submodule working trees.

After adding `+root`, git refused the checkout with "detected dubious ownership"
(repo owned by uid 1000, process is root), so `git merge-base` returned empty and the
job errored before building. Run `git config --global --add safe.directory '*'` at the
start so merge-base, worktree, and submodule operations work as root.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=f758451c29a819b0122eeefad59ab3f0774e6e38&name_0=PR
PR: #108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from f758451 to 80e0f47 Compare June 30, 2026 12:02
Reverts the bind-mount namespace (eb794ef), `+root` (ed56e51), and git
`safe.directory` (3c7d300) commits. The bind-mount-onto-/ClickHouse approach for
sccache reuse is a dead end: sccache is client-server and the server compiles in its
own mount namespace, not the client's, so it can't see the bind-mounted build dir
(`cd /ClickHouse/build: No such file or directory`). CCACHE_BASEDIR doesn't help
either — that's a ccache feature, the build uses sccache, and the master cache is
sccache-keyed.

The before-build is now a plain cold build of the worktree (~1h, ~0% sccache hits).
This is accepted: the job has no artifact dependency and runs in parallel with the
build matrix, so it is off the critical path. Documented inline so it is not
re-attempted naively. `--privileged` is kept (io_uring for the silk fiber runtime);
`+root` is dropped (only the namespace needed it), so git no longer hits the
dubious-ownership error.

Everything validated stays: lean scheduling, configure/compile split (no false
build-fail), submodule population, and the attributable-reproduction check.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from 80e0f47 to 1cc4dde Compare June 30, 2026 12:45
verbose=True,
)
Shell.check(
f"git fetch --prune --no-recurse-submodules --filter=tree:0 origin {base} ||:",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The validator must prove the before binary is built at the real merge base, but this fetch is allowed to fail and the next line still uses whatever origin/{base} ref happens to be present in the runner checkout. On a self-hosted runner with a stale base ref, a transient fetch/auth failure can make git merge-base choose an older commit; then a compile failure or test failure can be attributed to the bugfix even though it only came from testing against the wrong base. Please let the base-branch fetch failure propagate (or explicitly verify the fetched ref matches the PR base SHA) before creating the before-worktree.

…dation

`prepare_before_worktree` built shell commands by wrapping PR-controlled paths in
single quotes (`f"'{f}'"`) and passing them to `Shell.check` (shell=True). Because
`_UNIT_TEST_FILE_RE` permits single quotes, spaces, `&`, `#`, etc. in a filename, a PR
that adds e.g. `src/Foo/tests/a' && <command> #.cpp` would break out of the quoting and
run `<command>` on the CI runner before validation. The submodule paths read from the
PR's `.gitmodules` had the same flaw.

Shell-quote every PR-controlled path with `shlex.quote` (test files, submodule src/dst),
and add `--` so a leading-dash path can't be parsed as an option. The regex is not a
sanitizer; a regression test documents that contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from 1cc4dde to cad140e Compare June 30, 2026 12:59
nickitat and others added 4 commits June 30, 2026 13:29
…e, shared gate predicate

Addresses three review findings:

- build_gtest_filter missed typed gtest names. Typed tests are `Suite/0.Case` and
  `Prefix/Suite/0.Case`, which neither `Suite.*` nor `*/Suite.*` matches, so a PR adding
  only a typed regression test would run zero before-side cases and be misreported as
  "failed to reproduce". Add `Suite/*` and `*/Suite/*` patterns (+ tests covering all
  four gtest naming forms).

- A before-binary COMPILE failure was treated as a passing XFAIL. That only proves the
  overlaid test references some PR code (a new header/helper/symbol fails to compile on
  the merge-base too), not that it reproduces the bug. Report it as ERROR/inconclusive
  (fail close) instead of a pass.

- new_tests_check.has_new_unit_tests used a broader predicate (any path under
  src/**/tests/**) than the validator (a src source file with a runnable gtest suite),
  so a non-runnable file could satisfy the bugfix gate's unit shortcut while the
  validator skipped — passing the gate with no reproduction. Share the validator's exact
  predicate (regex + runnable-suite check).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…bugfix validation

Stacked on the new "Bugfix validation (unit tests)" job (PR #108827) to exercise
its reproduce path on real CI. `escapeForFileName` is changed to keep `.` verbatim
(the synthetic "fix"), and `gtest_bugfix_probe.cpp` asserts the new output. The
merge-base binary (without the fix) produces `a%2Eb` and fails the test; the PR
binary passes — so the job must report the bug as reproduced.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The previous synthetic "fix" stopped `escapeForFileName` from percent-encoding `.`,
but that function names on-disk data streams, so it caused real file-name collisions
and broke 12 functional tests (e.g. `a.size0` column vs `a` array's `.size0`
substream). Replace it with a sentinel input no real caller ever passes
(`__ch_bugfix_validation_probe__` -> `bugfix-validation-ok`): existing behavior is
completely unaffected, while the new gtest still fails on the merge-base (which returns
the sentinel unchanged) and passes on the PR — a clean runtime reproduction. CI test
only, do not merge.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat
nickitat force-pushed the gtest-bugfix-check-stageb-reproduce branch from cad140e to eeadd25 Compare June 30, 2026 13:30
@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.40% 85.40% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 77.60% 77.70% +0.10%

Changed lines: Changed C/C++ lines covered: 5/5 (100.00%) · Uncovered code

Full report · Diff report

nickitat added a commit that referenced this pull request Jun 30, 2026
…led-to-reproduce

The unit-test Bugfix Validation job was allow_failure=False, so an inconclusive ERROR
(the before-binary couldn't compile because the test references PR-introduced code, or
it crashed before any test ran, or submodules were missing) blocked merge just like a
definitive failed-to-reproduce. "We couldn't determine" is not grounds to block.

Make the job allow_failure=True (like the FT/IT bugfix jobs) and move the merge decision
into new_tests_check.py: for a unit-only bug-fix PR, block iff the job reported a
definitive FAIL (the added test passes on the merge-base too, so it doesn't catch the
bug). A reproduction (OK/XFAIL), an inconclusive ERROR, or a skip does not block.

Validated on real CI before this change: reproduce=OK (#108833), fail-to-reproduce=FAIL
(#108946), compile-inconclusive=ERROR (#108947). With this change the ERROR case
(#108947) no longer blocks; only the FAIL case (#108946) does.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@nickitat nickitat closed this Jul 1, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
A run of the synthetic reproduce test (PR ClickHouse#108833) "passed" for the wrong reason,
which surfaced two bugs:

1. False positive (fail-close violation). The job treated ANY before-binary build
   failure as proof the test depends on the fix. The actual failure was a `cmake`
   configure abort ("Submodules are not initialized", CMakeLists.txt) — an
   infrastructure problem — yet the job reported success. Split the build into a
   `configure` step and a `compile` step: a configure failure is now reported as an
   `ERROR` (inconclusive), and only a genuine `ninja` compile failure of the overlaid
   test counts as the "test depends on the fix" XFAIL proof. Also assert the submodule
   marker is present in the before-worktree before building and fail close if not.

2. Submodules never populated. `needs_submodules=True` only restores the submodule
   git data (`.git/modules`) from the S3 cache; the working-tree files must still be
   checked out. The job relied on hardlinking `contrib/*` from the primary checkout,
   but those working trees were empty, so nothing was copied. Add
   `ensure_primary_submodules` (mirroring the CHECKOUT_SUBMODULES stage of
   `build_clickhouse.py`: cache fast-path + full-fetch fallback) before the hardlink.

CI report (false positive): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=d5ede1be358c25a9ce56dcedc147b3ec8efcf9ca&name_0=PR
PR: ClickHouse#108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…tions

Run of PR ClickHouse#108833 "reproduced" via an unrelated abort, exposing two issues:

1. Wrong run environment. The before-binary runs in the binary-builder container,
   whose default seccomp profile blocks `io_uring`. `unit_tests_dbms` links the `silk`
   fiber runtime, which calls `io_uring_queue_init_params` at startup and aborts
   (`SILK_ASSERT(!r)`) when it is denied — before any test runs. Add `--privileged` to
   this job's docker (matching how the regular `Unit tests` job runs the same binary
   in `clickhouse/test-base+--privileged`) so the before-binary can initialize.

2. Unattributable crash counted as reproduction. A before-binary failure was treated
   as "bug reproduced" even when the binary died before any touched test ran. Require a
   gtest `[ RUN ]` marker (`before_run_started_a_test`): a failure/crash counts as a
   reproduction only if the touched suite actually started (this still covers legitimate
   crash-bugs that die mid-test); otherwise report `ERROR`/inconclusive. Fail close.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=905cf4af0fc7af775eaff662fd500554efb96e2b&name_0=PR
PR: ClickHouse#108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…orks

The before-build's sccache fix uses `unshare -m` + `mount --bind`, which need
CAP_SYS_ADMIN. Jobs run as `--user $(id -u)` (non-root) by default, so `unshare`
failed with "Operation not permitted" (configure step failed in 4 ms; correctly
reported as ERROR/inconclusive by the fail-close path, not a false pass). Add the
`+root` token so the job drops `--user` and runs as root — combined with the existing
`--privileged`, that grants CAP_SYS_ADMIN. Mirrors other privileged jobs
(stateless-test, integration) which also use `+root`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=09963e897dc78a56052a37647d305e59111dcd4a&name_0=PR
PR: ClickHouse#108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
After adding `+root`, git refused the checkout with "detected dubious ownership"
(repo owned by uid 1000, process is root), so `git merge-base` returned empty and the
job errored before building. Run `git config --global --add safe.directory '*'` at the
start so merge-base, worktree, and submodule operations work as root.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108833&sha=f758451c29a819b0122eeefad59ab3f0774e6e38&name_0=PR
PR: ClickHouse#108833

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…led-to-reproduce

The unit-test Bugfix Validation job was allow_failure=False, so an inconclusive ERROR
(the before-binary couldn't compile because the test references PR-introduced code, or
it crashed before any test ran, or submodules were missing) blocked merge just like a
definitive failed-to-reproduce. "We couldn't determine" is not grounds to block.

Make the job allow_failure=True (like the FT/IT bugfix jobs) and move the merge decision
into new_tests_check.py: for a unit-only bug-fix PR, block iff the job reported a
definitive FAIL (the added test passes on the merge-base too, so it doesn't catch the
bug). A reproduction (OK/XFAIL), an inconclusive ERROR, or a skip does not block.

Validated on real CI before this change: reproduce=OK (ClickHouse#108833), fail-to-reproduce=FAIL
(ClickHouse#108946), compile-inconclusive=ERROR (ClickHouse#108947). With this change the ERROR case
(ClickHouse#108947) no longer blocks; only the FAIL case (ClickHouse#108946) does.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant