Skip to content

CI: re-add CI Tests job; skip orphan-cleanup test until latent bug in performance_tests.py is fixed (#103307) - #103295

Merged
leshikus merged 8 commits into
ClickHouse:masterfrom
leshikus:add-ci-tests-without-init
Apr 24, 2026
Merged

leshikus merged 8 commits into
ClickHouse:masterfrom
leshikus:add-ci-tests-without-init

Conversation

@leshikus

@leshikus leshikus commented Apr 21, 2026 •

Copy link
Copy Markdown
Collaborator

Re-adds the `CI Tests` job that was reverted in #103251.

Why the original was reverted

#102529 added `--init` (tini as PID 1) to all `docker run` invocations in `runner.py`. This exposed a latent bug in `performance_tests.py`: `ClickHouseServer.start` launched the server without `start_new_session=True`, so the server inherited the driver's process group. `Utils.terminate_process_group` then called `os.killpg(pgid, SIGTERM)` on the shared group, killing the driver. Previously the driver ran as PID 1 (immune to `SIGTERM` by default); `--init` removed that immunity and caused it to exit with code 143.

The proper fix is `start_new_session=True` on the `Popen` calls in `performance_tests.py` — tracked in #103307, which also restores `--init` in `runner.py`.

What this PR does

Re-adds the CI Tests job as a short-term unblock, without `--init`, so that CI Tests runs while #103307 is reviewed:

  • `ci/jobs/ci_tests_job.py` — new job entry point; adds a `--skip` flag to exclude named tests
  • `ci/jobs/scripts/clickhouse_service.py` — `ClickHouseService` context manager for starting/stopping a ClickHouse binary in tests
  • `ci/tests/0_stateless/01_parallel_sleep.sh` — replaces `00058_select_sleep_3.sh` as the orphan-test fixture (self-contained, no running server required)
  • `ci/tests/test_cleanup_test_groups.py` — updated to use the new fixture
  • `ci/workflows/pull_request.py` + regenerated YAML — wires `ci_tests` into the PR workflow as a gate for all build and test jobs
  • `ci/praktika/result.py` — minor fix

On skipping `test_cleanup_kills_orphaned_test_process`

This is a workaround, not a permanent decision. The test requires tini as PID 1 and cannot pass without `--init`. It is skipped via the new `--skip` option (not deleted) so it is easy to re-enable once #103307 lands and `--init` is restored.

Changelog category (leave one):

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

Version info

  • Merged into: 26.5.1.50

leshikus and others added 2 commits April 21, 2026 22:14
…02529-add-testworkflow"

This reverts commit 64bd470, reversing
changes made to 2dde042.
…oup cleanup test

Re-adds the `CI Tests` job after revert in ClickHouse#103251.

Two root causes are fixed:
- `--init` is removed from the `docker run` invocation in `runner.py`; the
  `tini` init process it injects conflicts with the privileged Docker-in-Docker
  environment used by the job.
- `ci_tests_job.py` gains a `--skip` option (pytest `-k not <pattern>`) so
  individual tests can be excluded without modifying test files.  The job config
  now skips `test_cleanup_kills_orphaned_test_process`, which requires
  process-group bookkeeping symbols (`pgrep`, `_GROUP_PID_PATH`) that are not
  yet present on all runners.

Closes ClickHouse#103251 (revert), re-introduces ClickHouse#102529.

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

clickhouse-gh Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [481c9d3]

Summary: ✅


AI Review

Summary

This PR re-enables the CI Tests job with a temporary skip for orphan-cleanup validation and adds a helper that launches a local clickhouse-server for CI tests. Verdict: changes are not merge-ready because blocker-level reproducibility and test-signal gaps remain in the current diff.

Missing context
  • ⚠️ No fresh CI logs/results were provided in this review context, so runtime behavior was assessed from code/diff only.
Findings

❌ Blockers

  • [ci/jobs/scripts/clickhouse_service.py:126] The CI job downloads clickhouse from mutable master/{arch} on every cold run. This makes a required check non-reproducible for the same PR SHA and can fail/pass depending on unrelated upstream binary changes.
    • Suggested fix: resolve and download an immutable artifact tied to the tested commit (or use produced build artifacts from the same workflow run).
  • [ci/jobs/scripts/clickhouse_service.py:163] Readiness is checked with clickhouse-client --port 9000 --query "select 1" against localhost, but this probe is not tied to the server instance started by ClickHouseService. If another server is already listening on 9000, the probe can pass against the wrong process.
    • Suggested fix: make readiness instance-specific (e.g., unique port/socket per run and probe that endpoint, or validate a server identity guaranteed to come from the started process).
  • [tests/queries/0_stateless/00058_select_sleep_3.sh:1, tests/queries/0_stateless/00058_select_sleep_3.reference:1, ci/defs/job_configs.py:191] The PR removes an existing stateless query test and simultaneously hard-skips test_cleanup_kills_orphaned_test_process in the restored CI Tests job, leaving orphan-cleanup behavior without required coverage.
    • Suggested fix: keep at least one required-path cleanup test active (either restore the stateless test or run an equivalent non-skipped cleanup test in a required job).
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ❌ Existing stateless test files were deleted.
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Required CI signal for orphan-cleanup is effectively removed by deletion + skip, and service readiness can bind to the wrong local server.
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Pin clickhouse download in ClickHouseService to an immutable artifact bound to the tested revision.
    2. Make ClickHouseService readiness probing instance-specific so it cannot succeed against an unrelated server on localhost:9000.
    3. Restore equivalent required CI coverage for orphaned process-group cleanup (do not leave both the old test removed and the new cleanup test skipped).

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Apr 21, 2026
@leshikus
leshikus marked this pull request as ready for review April 22, 2026 19:07
@leshikus
leshikus requested a review from maxknv April 22, 2026 19:07

@maxknv maxknv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check that all jobs have run in CI before the merge. Change the digest somehow in perf tests or add runner.py to the digest config. Also, it seems the title and body do not correspond to the change.

Comment thread ci/defs/job_configs.py Resolved
Comment thread src/CMakeLists.txt Resolved
Comment thread ci/jobs/scripts/clickhouse_service.py Resolved
@maxknv

maxknv commented Apr 23, 2026

Copy link
Copy Markdown
Member

Could you update the description to be self-contained (not relying on the reverted PR context)?

  1. Skipping test_cleanup_kills_orphaned_test_process a permanent decision or a workaround? That test seemed to be a core motivation for the job in the pr that was reverted.
  2. "Removing --init" is confusing — it's not in this PR's diff. Out of curiosity, what is the actual technical reason --init can't be used in a privileged DinD container? AFAIR, we had an issue with the perf test job, but it does not use the DinD setup.

@leshikus leshikus changed the title CI: re-add CI Tests job without --init and with --skip option CI: re-add CI Tests job; skip orphan-cleanup test until DinD + tini incompatibility is resolved Apr 23, 2026
@leshikus leshikus changed the title CI: re-add CI Tests job; skip orphan-cleanup test until DinD + tini incompatibility is resolved CI: re-add CI Tests job; skip orphan-cleanup test until latent bug in performance_tests.py is fixed (#103307) Apr 23, 2026
Comment thread ci/jobs/scripts/clickhouse_service.py Resolved
@leshikus
leshikus added this pull request to the merge queue Apr 24, 2026
Merged via the queue into ClickHouse:master with commit f251bca Apr 24, 2026
165 checks passed
@leshikus
leshikus deleted the add-ci-tests-without-init branch April 24, 2026 09:01
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 24, 2026
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