Skip to content

Update C++ core and assert the service set a bucket ping reports - #251

Merged
avsej merged 2 commits into
couchbase:mainfrom
avsej:fix-mock-diagnostics-tests
Sep 9, 2026
Merged

avsej merged 2 commits into
couchbase:mainfrom
avsej:fix-mock-diagnostics-tests

Conversation

@avsej

@avsej avsej commented Sep 8, 2026

Copy link
Copy Markdown
Member

Motivation

test_bucket_ping asserts that a bucket ping reports key/value and
nothing else. CXXCBC-845, which added wait_until_ready, also made a
bucket-scoped ping cover the cluster-level HTTP services, so the
assertion describes a contract the core no longer has and every mock
job fails on it.

The reported set was not stable either. The ping collector completed as
soon as the number of in-flight pings reached zero, which it can do
while the fan-out is still being dispatched, and the cluster-level
services are pinged from the node list in the configuration the session
manager holds. A ping issued before that configuration arrives
registers no reporter for those services and completes on the key/value
reporters alone; one issued afterwards reports every service the
topology advertises.

Modifications

The core moves to efc5278,
which holds a dispatch scope open across the whole ping fan-out
(CXXCBC-1022) so the collector cannot complete while endpoints are
still being handed reporters.

The default bucket ping is then asserted to report key/value and to
cover the same services as a cluster ping, which states the current
contract without naming the services a particular cluster happens to
deploy. The single-service case takes its service list from the
cluster's own ping rather than a fixed one, so it exercises the
bucket-scoped filtering for every service the cluster under test
deploys, and requires key/value among them so that an empty list cannot
satisfy it.

Results

A bucket ping reports every service the topology advertises, regardless
of when it is issued relative to the configuration arriving. The
comparison against a cluster ping distinguishes the fixed core from the
broken one: against a core without CXXCBC-1022 a bucket ping that runs
before the configuration reaches the session manager reports key/value
alone and the comparison fails.

@avsej
avsej requested review from DemetrisChr and a balanced review from Copilot September 8, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The assertions accurately cover both timing-dependent default behavior and deterministic service filtering.

Pull request overview

Updates diagnostics tests for bucket pings that may include cluster-level services.

Changes:

  • Requires default bucket pings to include key/value.
  • Adds deterministic coverage for key/value-only bucket pings.
File summaries
File Description
test/diagnostics_test.rb Adjusts bucket ping assertions and adds a scoped ping test.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@avsej avsej added the rubber stamp needed Reviewed & ready internal/infrastructure change. Needs light approval. No public API impact. label Sep 8, 2026
Comment thread test/diagnostics_test.rb Outdated
@avsej
avsej force-pushed the fix-mock-diagnostics-tests branch from 5a479e4 to 135a255 Compare September 9, 2026 15:41
@avsej avsej changed the title Test: adjust bucket ping assertions for cluster-level services Update C++ core and assert the service set a bucket ping reports Sep 9, 2026
Motivation
----------
The ping collector completed as soon as the number of in-flight pings
reached zero, which it can do while the fan-out is still being
dispatched. The cluster-level services are pinged from the node list in
the configuration the session manager holds, so a ping issued before
that configuration arrives registers no reporter for them and completes
on the key/value reporters alone. Bucket#ping therefore reported
key/value by itself or every service the topology advertises, depending
on which won that race.

Modifications
-------------
The core moves to efc5278, which holds a dispatch scope open across the
whole ping fan-out (CXXCBC-1022) so the collector cannot complete while
endpoints are still being handed reporters. The range also carries
per-thread allocation counting and the migration of the core unit tests
onto their new framework.

Results
-------
Bucket#ping and Cluster#ping report every service the topology
advertises, regardless of when they are issued relative to the
configuration arriving. test_bucket_ping asserts that a bucket ping
reports key/value and nothing else, which stopped being the contract in
CXXCBC-845, so that test now fails on every run rather than only when
the race goes against it.
Motivation
----------
test_bucket_ping asserts that a bucket ping reports key/value and
nothing else. CXXCBC-845, which added wait_until_ready, also made a
bucket-scoped ping cover the cluster-level HTTP services, so the
assertion describes a contract the core no longer has and fails on
every run. Nothing covered the bucket-scoped path for any service other
than key/value.

Modifications
-------------
The default bucket ping is asserted to report key/value and to cover
the same services as a cluster ping, which states the current contract
without naming the services a particular cluster happens to deploy. The
single-service case takes its service list from the cluster's own ping
rather than a fixed one, so it exercises the bucket-scoped filtering
for every service the cluster under test deploys, and requires
key/value among them so that an empty list cannot satisfy it.

Results
-------
The comparison against a cluster ping distinguishes the fixed core from
the broken one: against a core without CXXCBC-1022 a bucket ping that
runs before the configuration reaches the session manager reports
key/value alone and the comparison fails.
@avsej
avsej force-pushed the fix-mock-diagnostics-tests branch from 135a255 to 19874b3 Compare September 9, 2026 15:58
@avsej
avsej merged commit 71ab27f into couchbase:main Sep 9, 2026
39 of 44 checks passed
@avsej
avsej deleted the fix-mock-diagnostics-tests branch September 9, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rubber stamp needed Reviewed & ready internal/infrastructure change. Needs light approval. No public API impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants