Skip to content

Test bugfix validation against multiple build types - #96868

Merged
alexey-milovidov merged 4 commits into
masterfrom
bugfix-validation-multiple-build-types
Feb 15, 2026
Merged

alexey-milovidov merged 4 commits into
masterfrom
bugfix-validation-multiple-build-types

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Bugfix Validation now tests against 5 AMD build types from master (ASan, TSan, MSan, UBSan, Debug) instead of a single release binary
  • Catches bugs detectable only under specific sanitizers or build modes
  • The check passes if at least one of the 5 builds reproduces the bug; each test result is labeled with its build type

Test plan

  • Verify find_master_builds correctly resolves S3 URLs for recent master commits
  • Verify FT bugfix validation downloads all 5 binaries and runs tests with each
  • Verify IT bugfix validation downloads all 5 binaries and runs pytest with each
  • Verify result inversion works correctly across all build types (pass if any reproduces the bug)
  • Verify FT bugfix validation job runs on AMD runner

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

Version info

  • Merged into: 26.2.1.720

…, UBSan, Debug)

The Bugfix Validation check now downloads and tests against all 5 AMD
build types from master instead of a single release binary. This catches
bugs that are only detectable under specific sanitizers or build modes.

The check passes if at least one of the 5 build types reproduces the bug.
Each test result is labeled with its build type for traceability.

Both functional tests and integration tests bugfix validation are updated.
The FT bugfix validation job is moved to AMD runners since all 5 build
types are AMD-only.

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

clickhouse-gh Bot commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a1531e9]

Summary: ✅

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Feb 14, 2026
alexey-milovidov and others added 3 commits February 14, 2026 05:15
The `bugfix_validation_functional_tests` job runner was changed from
`arm-medium` to `amd-medium` in the Python config but the generated
`.github/workflows/pull_request.yml` was not regenerated.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@maxknv

maxknv commented Feb 15, 2026

Copy link
Copy Markdown
Member

imho, the added complexity outweighs the benefits

@alexey-milovidov

Copy link
Copy Markdown
Member Author

But at least it will work as intended.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

At least I'd like to give it a try. This is how I envisioned this check from the beginning - when I designed it.

@alexey-milovidov
alexey-milovidov merged commit 471662d into master Feb 15, 2026
131 checks passed
@alexey-milovidov
alexey-milovidov deleted the bugfix-validation-multiple-build-types branch February 15, 2026 13:39
@alexey-milovidov alexey-milovidov self-assigned this Feb 15, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 15, 2026
pull Bot pushed a commit to Spencerx/ClickHouse that referenced this pull request Sep 20, 2026
`Bugfix validation (unit tests)` built the merge-base "before" binary under a single
build type (`BUILD_TYPE = BuildTypes.AMD_ASAN_UBSAN`, introduced by b5abadc and
never changed) and refuted the PR's regression gtest whenever every touched test passed
on it. A regression test whose asserted property is only observable under a different
sanitizer passes on that binary either way, so `main()` reported `Result.Status.FAIL` /
"Failed to reproduce the bug." and `new_tests_check.py:220-227` turned that into a red
`Finish Workflow` for a unit-only bugfix PR. The refutation was guaranteed by
construction and independent of whether the fix and the test were correct: the run could
not observe what it was asked to judge.

This is an asymmetry with the job's own siblings, not an oversight in the abstract.
`ci/jobs/scripts/bugfix_validation.py:9-10` already validates functional/integration
tests across `[amd_asan_ubsan, amd_tsan, amd_msan, amd_debug]` and passes if any arm
reproduces. Those validators can afford four because they download prebuilt master
binaries, while this job must build each arm cold (~1h, ~0% sccache hits, documented in
`configure_before_binary`), which is why its set was never widened.

Escalate lazily instead: keep ASan+UBSan as the first arm and try the next build type
only when an arm ran every touched test with none failing. The arms share one build
directory, emptied between them fail-closed, because configuring a different `SANITIZE`
value on top of the previous `CMakeCache.txt` builds one sanitizer while the report names
another. FAIL after the last arm still blocks, preserving the contract set by
0154e71 ("only on failed-to-reproduce"), and `new_tests_check.py` is untouched.

Each arm's `Result` carries its build type, which is a correctness requirement rather
than cosmetics: `Result.from_commands_run` derives the log path from the result name
(`{TEMP_DIR}/{normalize_string(name)}.log`), so two arms sharing a name write one file
and the second overwrites the configure and compile logs of the arm that started the
escalation.

`run_gtests` now pins `external_symbolizer_path`. A sanitizer report is symbolized before
the process aborts, and with no unversioned `llvm-symbolizer` on PATH the runtime falls
back to `addr2line`, which does not finish on the multi-GB binary: measured locally, two
runs of the TSan before-binary sat at 900 s and 420 s with no output while the writer
thread held `Context::mutex` inside `Addr2LineProcess::ReadFromSymbolizer`, and with the
option set the same run aborts in 8 s with a fully symbolized report.
`ci/docker/test-base/Dockerfile` creates that symlink deliberately, but this job runs in
binary-builder, which installs `llvm-symbolizer-<version>` and symlinks only
profdata/cov/bolt/merge-fdata.

Measured on ClickHouse#115659's two gtests overlaid on a tree without its fix: the TSan
before-binary aborts on a data race between `Context::getReadSettings` and
`SettingsImpl::set` in 8-9 s, 5 of 5 runs; ASan+UBSan reports `fail: 0, passed: 9`,
matching what CI reported; with the fix applied TSan is green 3 of 3. Fed through
praktika's own runner, the aborted run yields `Result.Status.FAIL` with the crashed test
recovered as `Context.GetReadSettingsRace`, which is the reproduction branch of `main()`.
One arm took 57.7 min against the job's 240-min timeout, and 14 of 3782 `Bugfix
validation (unit tests)` rows over 180 days (0.37%) reach a second arm.

Scope: ASan+UBSan and TSan. `amd_msan` and `amd_debug` stay excluded, so a regression
test that needs one of them is still refuted by a run that cannot observe it; adding
either is a one-element change to `BEFORE_BUILD_TYPES` plus a timeout increase.

ClickHouse#96868 validated bugfixes against multiple build types eagerly and was reverted three
hours later by ClickHouse#97011. This differs by escalating lazily on a job that already builds
cold, two arms rather than five, no S3 artifact dependency, and no change to job
scheduling or `ci/defs/`.

The eight new arms in `ci/tests/test_unit_tests_bugfix_validation.py` are mutation-proven:
removing the return after a reproduction, deleting the escalation, dropping the
refutation status, escalating from the "ran no touched test" branch, making the build-dir
reset best-effort, and collapsing the per-arm result names each redden their own arm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants