Skip to content

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

Merged
leshikus merged 1 commit into
masterfrom
revert-99283-enable-mac-clickhouse-test
Apr 9, 2026
Merged

leshikus merged 1 commit into
masterfrom
revert-99283-enable-mac-clickhouse-test

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Apr 9, 2026 •

Copy link
Copy Markdown
Member

Reverts #99283

Version info

  • Merged into: 26.4.1.699

@clickhouse-gh

clickhouse-gh Bot commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6fd86e6]


AI Review

Summary

This PR reverts #99283, removing the macOS ARM fast-test path and restoring prior test-launch behavior in CI/test scripts. I found a real robustness regression in tests/clickhouse-test: several pgrep calls were changed to subprocess.check_output, which throws on normal "no matches" (exit 1) cases and can break cleanup. I also found PR metadata quality issues (missing template fields).

Missing context
  • ⚠️ No CI logs or Praktika reports were provided, so I could not validate whether these cleanup paths already failed in CI.
Findings

❌ Blockers

  • [tests/clickhouse-test:591, 604, 677, 687] subprocess.check_output is now used with pgrep in cleanup/termination paths. pgrep returns exit code 1 when no processes match, and check_output raises CalledProcessError in that normal state. This can interrupt cleanup and leave child processes/process groups not handled.
    Suggested fix: use subprocess.run(..., capture_output=True, text=True) and treat return codes 0 and 1 as expected; parse stdout only when return code is 0.

💡 Nits

  • [PR description] Changelog category and Changelog entry are missing (template not filled). For this PR, category should be CI Fix or Improvement, where changelog entry is not required.
    Suggested replacement text:
    • ### Changelog category (leave one): CI Fix or Improvement
    • ### Changelog entry: not required for this category
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ⚠️ PR template fields (Changelog category, Changelog entry) are not filled
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Performance & Safety
  • The pgrep/check_output change is a safety/robustness issue in process cleanup logic: expected empty-match states now raise exceptions and may short-circuit termination paths.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Handle pgrep exit code 1 as a normal case in cleanup paths (kill_process_group, cleanup_child_processes) instead of letting check_output raise.
    • Fill PR template metadata with Changelog category set to CI Fix or Improvement.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 9, 2026
Comment thread tests/clickhouse-test
print(
'\n'.join(f"{p[0]} {p[3]}" for p in pgrep(ppid=pid)),
subprocess.check_output(
f"pgrep --parent {pid} -a", shell=True, stderr=subprocess.STDOUT

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.

subprocess.check_output("pgrep --parent ...") raises CalledProcessError when there are no child processes (exit code 1). In that normal case, cleanup_child_processes now throws instead of returning an empty list, which can interrupt shutdown handling and leave stale processes around.

Can we switch this to subprocess.run(..., capture_output=True, text=True) and treat return codes 0/1 as non-exceptional, parsing output only on 0?

Comment thread tests/clickhouse-test
print(
'\n'.join(f"{p[0]} {p[3]}" for p in pgrep(pgid=pgid)),
subprocess.check_output(
f"pgrep --pgroup {pgid} -a", shell=True, stderr=subprocess.STDOUT

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.

Same issue here: pgrep exits with code 1 when the process group is already empty, and check_output turns that into an exception. That means kill_process_group can fail before cleanup logic runs.

Please handle pgrep via subprocess.run (or catch CalledProcessError specifically for return code 1) so an empty group is treated as expected state.

@leshikus

leshikus commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Should be reverted until I investigate the failure

@leshikus
leshikus enabled auto-merge April 9, 2026 09:02
@leshikus
leshikus added this pull request to the merge queue Apr 9, 2026
Merged via the queue into master with commit f878710 Apr 9, 2026
159 of 162 checks passed
@leshikus
leshikus deleted the revert-99283-enable-mac-clickhouse-test branch April 9, 2026 10:03
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.

3 participants