Skip to content

Revert "ci: fix fast limits" - #98026

Merged
alexey-milovidov merged 1 commit into
masterfrom
revert-97823-tests/limits_fast
Feb 26, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
revert-97823-tests/limits_fast

Conversation

@alexey-milovidov

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

Copy link
Copy Markdown
Member

Reverts #97823

● So the summary is:                                                                                                                                                                                                                                                                                      
                                                        
  1. PR #97823 (ci: fix fast limits) fixed the is_fast_build function so it actually works                                                                                                                                                                                                                
  2. This function now correctly detects "fast" builds (no sanitizers, with NDEBUG) and installs limits_fast.yaml                                                                                                                                                                                         
  3. limits_fast.yaml sets max_execution_time: 60                                                                                                                                                                                                                                                         
  4. The LLVM coverage build passes the "fast build" check because it uses -fprofile-instr-generate -fcoverage-mapping (not -fsanitize=) and has -DNDEBUG                                                                                                                                                 
  5. But coverage instrumentation adds significant overhead (~2-3x), so heavy tests exceed the 60s limit

  The fix should make is_fast_build also exclude coverage builds. The function should additionally check for -fprofile-instr-generate or -fcoverage-mapping in the build flags. Something like:

  function is_fast_build()
  {
      if [[ $USE_S3_STORAGE_FOR_MERGE_TREE -eq 1 ]] || [[ $USE_AZURE_STORAGE_FOR_MERGE_TREE -eq 1 ]]; then
          return 1
      fi
      if [[ $USE_ENCRYPTED_STORAGE -eq 1 ]]; then
          return 1
      fi
      # sanitizers, debug, and coverage builds are slow
      [ "$(clickhouse local --query "SELECT value NOT LIKE '%-fsanitize=%' AND value LIKE '%-DNDEBUG%' AND value NOT LIKE '%-fprofile-instr-generate%' FROM system.build_options WHERE name = 'CXX_FLAGS'")" -eq 1 ]
  }

Version info

  • Merged into: 26.3.1.55

@clickhouse-gh

clickhouse-gh Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8f4c69a]

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Feb 26, 2026
@alexey-milovidov alexey-milovidov self-assigned this Feb 26, 2026
@alexey-milovidov
alexey-milovidov merged commit 2279d48 into master Feb 26, 2026
1 check failed
@alexey-milovidov
alexey-milovidov deleted the revert-97823-tests/limits_fast branch February 26, 2026 06:09
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 26, 2026
pull Bot pushed a commit to sowelswl/ClickHouse that referenced this pull request Jul 31, 2026
…alled

is_fast_build only returned an exit code and printed nothing, while the call
site consumed stdout via [[ $(is_fast_build) == 1 ]]. The command substitution
was therefore always empty, the branch never taken, and
tests/config/users.d/limits_fast.yaml never installed on any job - fast build
or not. So max_execution_time / max_execution_time_leaf have never been in
effect in CI. One consequence is that the CancellationChecker watchdog, which
is only armed when max_execution_time > 0, never ran on these jobs, so a query
waiting inside the server had no timeout.

Make the function a predicate and call it as one. This re-lands ClickHouse#97823, which
fixed the same thing and was reverted by ClickHouse#98026 because the LLVM coverage build
passes the "fast build" predicate while being 2-3x slower. That objection was
correct, so the coverage exclusion is included - but not the probe the revert
suggested: coverage flags are applied per directory via add_compile_options and
never reach CMAKE_CXX_FLAGS, so they cannot be seen in the CXX_FLAGS row. Use
the dedicated WITH_COVERAGE build option instead, which is what
tests/clickhouse-test and tests/integration/helpers/cluster.py already read.
Putting the check in the predicate rather than in the caller also covers
tests/docker_scripts/stress_tests.lib, which invokes install.sh without
--llvm-coverage.

Two deliberate differences from ClickHouse#97823: its USE_ENCRYPTED_STORAGE=0 default
line is not re-landed, because it clobbers the export in stress_runner.sh and
would silently disable the encrypted-storage guard on the one job that sets the
variable; and the environment checks use == rather than -eq, matching what
install.sh already does for these same variables.

ClickHouse#97823 was live on master for 6h43m, which measures this change without a
coverage exclusion: all 19 TIMEOUT_EXCEEDED rows in that window were on
amd_llvm_coverage, while the arm_binary stateless jobs ran with the symlink
installed and had no failures.
pull Bot pushed a commit to sowelswl/ClickHouse that referenced this pull request Jul 31, 2026
…with a test

The gate is a conjunction of two independent decisions, and only the first was
addressed by the previous commit. Which build kinds can take a 60 second
per-query cap is what is_fast_build answers. Which jobs should get the profile
at all is a separate question that the original one-line gate never asked.

Measured over 7 days of master, three tests that run on jobs satisfying
is_fast_build exceed 60 seconds in a single server-side query, so enabling the
profile for all of them would redden currently green runs.
03988_cached_read_big_at on Stateless tests (arm_binary, sequential) is the
clearest: its whole body is one SELECT over test.hits_parquet, and its 139 runs
are 139/139 above the cap with a minimum of 320970 ms, so it would fail
deterministically on every PR and every master commit. Rather than weaken or
tag those tests to fit a CI config change, gate the symlink on FAST_TEST, which
has one setter and one caller, so the affected set is closed by construction:
Fast test and Fast test (arm_darwin), nothing else. There the exposure is zero
out of 52201028 OK rows, and structurally so, because the runner already kills a
test file after 60 seconds of wall clock (--timeout 60) and skips the long and
stateful tests entirely, so a per-query cap of the same value cannot fire on a
healthy test. The three guards inside is_fast_build are kept on top of the job
scope, so a future Fast test flavour built with sanitizers, coverage or object
storage still would not get the profile.

Add ci/tests/test_install_sh_fast_limits.py, run by the existing CI Tests job.
Nothing asserted on this symlink before, which is how the dead branch survived
from ClickHouse#98026 until now: reverting the fix passed CI. The test drives the real
install.sh with a stub clickhouse earlier on PATH answering the
system.build_options probes, and asserts on the resulting symlink rather than on
trace text. The shell function under test is not stubbed. Each guard is
separately load-bearing: reverting the call site, dropping the FAST_TEST
condition, and removing any one of the three guards each fails the suite.

Also compare the build kind probe as a string instead of with -eq. The result is
empty when the CXX_FLAGS row is absent, which is reachable because
upgrade_runner.sh runs the install with a previous-release binary on PATH, and
-eq on an empty string makes bash print "integer expression expected" and return
2. That is fail-open by accident rather than by construction, and == is what
install.sh already uses for these same variables.
pull Bot pushed a commit to sowelswl/ClickHouse that referenced this pull request Jul 31, 2026
… scheduled

Two review findings on the limits_fast.yaml gate.

The WITH_COVERAGE guard inside is_fast_build failed OPEN: when the probe could
not answer (a binary without that row returns zero rows, so the substitution is
empty) the `if [[ "$x" == "1" ]]` fell through and the predicate proceeded
toward installing the profile. That direction is wrong specifically for
coverage, because the guard exists precisely because coverage flags are applied
per directory and never reach CXX_FLAGS, so the build-kind check cannot
compensate: a coverage build carries -DNDEBUG and no -fsanitize=, would report
"fast", and would get the 60 s cap, which is the regression ClickHouse#98026 reverted
ClickHouse#97823 for. Inverting the probe to `NOT IN ('ON', '1')` and comparing `!= "1"`
makes an unanswerable probe decline, degrading to the previous no-symlink
behaviour. Every answerable state keeps its verdict, verified against a real
server for OFF, ON, on and 1. The test that had asserted the fail-open
direction now asserts the decline, and a new mutation reverts only the
direction so nothing else has to pin it.

The new gate test also could not protect the file it guards. JobConfigs.ci_tests
had digest_config include_paths=["./ci"], which drives both is_affected_by and
calc_job_digest, and cache records are keyed only on (job_name, job_digest). A
later PR editing only tests/config/install.sh therefore left the CI Tests digest
byte-identical and resolved a cached success, so the test would never run -- the
same defect class as the bug this fixes, one level up. Measured: the digest was
identical across a mutation of the gate line before this change and differs
after it, while is_affected_by stays false for unrelated paths.

Also reworded the call-site comment: the runner gives each test file a 60 second
wall-clock budget rather than killing it promptly at 60 seconds, since
clickhouse-test waits on the timeout and kills the process group later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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