Skip to content

Changes for macOS: Use bash to run tests and fix clickhouse-test shell compatibility - #99283

Merged
leshikus merged 24 commits into
ClickHouse:masterfrom
leshikus:enable-mac-clickhouse-test
Apr 8, 2026
Merged

leshikus merged 24 commits into
ClickHouse:masterfrom
leshikus:enable-mac-clickhouse-test

Conversation

@leshikus

@leshikus leshikus commented Mar 11, 2026 •

Copy link
Copy Markdown
Collaborator

Enables the Darwin fast test CI job by adding a skip list of tests that don't pass on macOS (distributed tests requiring multiple nodes, tests relying on Linux-specific features, etc.) and fixing clickhouse-test for macOS compatibility: explicit bash shell for .sh tests, platform-independent process group handling, and minor related fixes.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Version info

  • Merged into: 26.4.1.664

@clickhouse-gh

clickhouse-gh Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8c26077]

Summary: ❌

job_name test_name status info comment
Stress test (arm_msan) failure
Cannot start clickhouse-server FAIL cidb, issue ISSUE EXISTS
Check failed failure cidb, issue ISSUE EXISTS

AI Review

Summary

This PR enables Darwin fast tests by adding a dedicated arm_darwin fast-test job, introducing a large macOS skip list, and adapting clickhouse-test process/shell handling for macOS compatibility. The direction is reasonable, but there are blocking CI-signal issues and one process-selection correctness risk that should be fixed before merge.

Missing context
  • ⚠️ No fresh CI report/log links were provided in this review task, so runtime behavior was evaluated from code only.
Findings

❌ Blockers

  • [ci/defs/job_configs.py:196] Darwin fast-test runs fast_test.py with --set-status-success, which force-publishes success even when tests fail. This removes failure signal from the job and can hide real regressions.
    • Suggested fix: remove --set-status-success from the Darwin fast-test command and rely on allow_merge_on_failure=True if non-blocking behavior is still desired.

⚠️ Majors

  • [ci/jobs/fast_test.py:853] --timeout 60 is added to the shared fast_test_command, which affects both regular and Darwin fast tests. This changes timeout semantics globally and can cause unrelated flaky failures (slow-but-valid tests now fail at 60s).
    • Suggested fix: keep default timeout for regular fast tests and apply a Darwin-specific timeout override only in the Darwin path.
  • [tests/clickhouse-test:990] get_all_server_pids uses substring matching (command="clickhouse-server" in ps command line). This can include clickhouse-server-bridge and other similarly named processes, producing noisy or incorrect stacktrace collection/attachments.
    • Suggested fix: match executable basename exactly (equivalent to prior pgrep -x clickhouse-server semantics), while keeping process-group scoping.
Tests
  • ⚠️ Add a regression test that verifies Darwin fast-test result status reflects real test failures (i.e., no forced green status).
  • ⚠️ Add a regression test covering PID filtering to ensure only clickhouse-server processes are selected (not clickhouse-server-bridge).
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ⚠️ Hardcoded global --timeout 60 changes behavior for all fast tests
Backward compatibility ➖
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Forced-green Darwin fast-test job can conceal regressions
Compilation time ✅
User-Lens
  • Unexpectedly green CI status for failing Darwin fast tests would be confusing for contributors and reviewers.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Remove forced-success status publishing from Darwin fast test (--set-status-success).
    2. Scope --timeout 60 to Darwin-only behavior (or remove it from shared fast-test command).
    3. Tighten server PID matching to exact clickhouse-server process name.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Mar 11, 2026
@leshikus
leshikus marked this pull request as draft March 12, 2026 11:53
@alexey-milovidov alexey-milovidov changed the title Use bash to run tests and fix clickhouse-test shell compatibility Changes for macOS: Use bash to run tests and fix clickhouse-test shell compatibility Mar 20, 2026
@leshikus
leshikus force-pushed the enable-mac-clickhouse-test branch from c2abcef to 28b784d Compare March 20, 2026 11:37
Comment thread tests/clickhouse-test Resolved
Comment thread tests/clickhouse-test Resolved
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
Comment thread ci/workflows/nightly_test_enabling.py Resolved
Comment thread tests/clickhouse-test Resolved
Comment thread ci/defs/job_configs.py Resolved
Comment thread tests/clickhouse-test Resolved
@leshikus
leshikus force-pushed the enable-mac-clickhouse-test branch from 1a4e597 to 9c718f4 Compare April 2, 2026 15:40
Comment thread ci/jobs/fast_test.py Resolved
@leshikus
leshikus force-pushed the enable-mac-clickhouse-test branch from 0d46eba to ae93d73 Compare April 2, 2026 18:39
Comment thread ci/defs/defs.py Resolved
Comment thread tests/clickhouse-test Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

Comment thread tests/clickhouse-test Resolved
Comment thread tests/clickhouse-test Resolved
Comment thread ci/defs/job_configs.py Resolved
@maxknv

maxknv commented Apr 7, 2026

Copy link
Copy Markdown
Member

Darwin fast test (arm_darwin) -> MacOS Fast tests, Fast test (arm_darwin)

The list is now a `_DARWIN_SKIP_TESTS` constant in `fast_test.py` and is
applied automatically when `platform.system() == "Darwin"`, so the Darwin
job command no longer needs a long `--skip` argument.

Also rename `parent` argument to `ppid` in `pgrep` in `clickhouse-test`.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@leshikus

leshikus commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator Author

@maxknv "Darwin fast test (arm_darwin) -> MacOS Fast tests, Fast test (arm_darwin)"

why should one use the name with comma and mixed case? shouldn't we use the same term (Darwin) everywhere? how critical is the need for this fix?

@leshikus
leshikus marked this pull request as ready for review April 7, 2026 23:09
@leshikus
leshikus requested a review from maxknv April 7, 2026 23:09
@maxknv

maxknv commented Apr 8, 2026

Copy link
Copy Markdown
Member

@maxknv "Darwin fast test (arm_darwin) -> MacOS Fast tests, Fast test (arm_darwin)"

why should one use the name with comma and mixed case? shouldn't we use the same term (Darwin) everywhere? how critical is the need for this fix?

Pick one of them (not both with comma :D), I like the latest, or find another name without two times darwin in it

@leshikus
leshikus added this pull request to the merge queue Apr 8, 2026
Merged via the queue into ClickHouse:master with commit 7c7cf83 Apr 8, 2026
162 of 164 checks passed
@leshikus
leshikus deleted the enable-mac-clickhouse-test branch April 8, 2026 15:54
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 8, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

See #102158 (comment)

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.

4 participants