Skip to content

Fix scope of silk socket unit test set up and tear down - #110380

Closed
mstetsyuk wants to merge 2 commits into
masterfrom
silk-test-scoped-scheduler
Closed

mstetsyuk wants to merge 2 commits into
masterfrom
silk-test-scoped-scheduler

Conversation

@mstetsyuk

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

We now only initialize and destroy Silk runtime for Silk unit tests.

@clickhouse-gh

clickhouse-gh Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [345e9c1]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_msan, 7/8) FAIL
test_replicated_database/test.py::test_replicated_table_structure_alter FAIL cidb, issue
AST fuzzer (amd_debug) FAIL
Segmentation fault (STID: 4211-3a99) FAIL cidb

AI Review

Summary

This PR moves Silk runtime initialization out of the global gtest environment and into SilkFiberSocketTest::SetUpTestSuite() so non-Silk unit tests do not eagerly start Silk. The setup side improved, but the teardown side is still global, so the runtime remains process-scoped after the first Silk suite runs. Verdict: not ready.

PR Metadata

⚠️ Changelog category is not semantically correct for a unit-test-only change. This should be Not for changelog (changelog entry is not required) instead of Bug Fix, and the changelog entry can be removed.

Findings

❌ Blockers

  • [src/IO/tests/gtest_silk_fiber_stream_socket.cpp:42-48,84-96] The PR promises to initialize and destroy Silk only around the Silk socket tests, but silk::FiberScheduler::destroy() / silk::destroy() still run from the global testing::Environment at process shutdown. unit_tests_dbms links every gtest*.cpp under src/ into one binary, so once SetUpTestSuite() initializes Silk, any later suite in that process still executes with Silk active. That leaves the runtime binary-scoped rather than suite-scoped, so the original isolation bug is still present. Suggested fix: pair the initialization with TearDownTestSuite(), and if both typed instantiations need to share one runtime instance, keep the lifetime in a small shared helper or refcount instead of a global environment teardown.
Final Verdict

❌ Changes required before merge. The teardown half of the scope fix is still missing, and the PR metadata should be switched to Not for changelog.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 14, 2026
silk::FiberScheduler::initialize(&options);
}

void TearDown() override

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.

Keeping silk::destroy() in the global environment still makes the runtime process-scoped after the first SilkFiberSocketTest suite runs. unit_tests_dbms links every gtest*.cpp under src/, so any non-Silk suite that runs later still executes with Silk initialized. That means the teardown half of the scope fix is still missing; to actually confine the runtime to the Silk tests, this needs a suite-local teardown (for example TearDownTestSuite() plus a small shared refcount across the typed instantiations).

@clickhouse-gh

clickhouse-gh Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.15% 86.16% +0.01%
Functions 91.48% 91.48% +0.00%
Branches 78.69% 78.71% +0.01%

Changed lines: Changed C/C++ lines covered: 10/11 (90.91%) · Uncovered code

Newly covered by added/modified tests: 49 line(s), 2 function(s) across 1 file(s) · Details

Top files
  • src/IO/tests/gtest_silk_fiber_stream_socket.cpp: 49 line(s), 2 function(s)

Full report · Diff report

@mstetsyuk mstetsyuk added the ci-no-coverage Skip LLVM coverage jobs. Use sparingly: also drops test configs that only run under coverage label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-coverage Skip LLVM coverage jobs. Use sparingly: also drops test configs that only run under coverage pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant