Skip to content

CBG-4625: test-only additional ISGR peers now take same subprotocol - #8659

Open
torcolvin wants to merge 2 commits into
mainfrom
CBG-4625
Open

CBG-4625: test-only additional ISGR peers now take same subprotocol#8659
torcolvin wants to merge 2 commits into
mainfrom
CBG-4625

Conversation

@torcolvin

@torcolvin torcolvin commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

CBG-4625: test-only additional ISGR peers now take same subprotocol

addActiveRT built extra active nodes without ISGRSupportedBLIPSubprotocols, so in revtree subtests node 2 negotiated CBMobile_4, causing occaisonal downstream failure. A replication
reassigned to it re-pulled already-replicated docs over V4 and wrote them as new revs, adding sequences and breaking the "exactly N changes since X" assertions (TestReplicationHeartbeatRemoval flake). If the replication didn't get reassigned, the test would pass.

  • Do a magic dance of recreating open channel for DatabaseConfig.ServerContextHasStarted and closing it after setting subprotocol.
  • DatabaseConfig is a mutable object when adding to a Database, so removed RestTesterConfig from places in order to add the specific options.
  • Now match the SyncFn and other parameters for second RestTester

Pre-review checklist

  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

@torcolvin
torcolvin requested review from a team and a lite review from Copilot August 24, 2026 13:42
@factory-droid

factory-droid Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Droid finished @torcolvin's task —— View job


LGTM, no high-confidence actionable issues found in the changes. The ISGR test harness updates should make BLIP subprotocol negotiation consistent across additional active nodes and reduce flakiness.

Copilot AI left a comment

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.

Pull request overview

This PR stabilizes ISGR-related test runs by ensuring additional (test-only) active peers in an ISGR “cluster” negotiate the same BLIP subprotocol as the primary active peer, preventing occasional protocol mismatches that caused flaky replication assertions.

Changes:

  • Added a test-only RestTesterConfig option to force ISGR BLIP subprotocols per node, and delayed ISGR replication startup until the subprotocol override is applied.
  • Refactored ISGR test peer setup to build per-node RestTesterConfig (avoiding mutation/reuse issues) and to support adding additional active nodes consistently.
  • Updated replicator/BLIP tests to use the new peers helper and to explicitly pass supported BLIP subprotocols where active replicators are constructed directly.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rest/utilities_testing.go Adds ISGRSupportedBLIPSubprotocols and delays replication startup so the override is applied before ISGR begins.
rest/utilities_testing_isgr.go Refactors ISGR peer setup to generate per-node configs, share buckets correctly, and support adding additional active peers with consistent subprotocols.
rest/replicatortest/replicator_test.go Switches tests to the new peers helper and threads supported subprotocols into direct replicator configs where needed.
rest/replicatortest/replicator_test_legacy_rev_test.go Updates legacy revision tests to use the new peers helper and delta-sync option handling.
rest/replicatortest/replicator_test_helper.go Removes the old addActiveRT helper in favor of TestISGRPeers.AddActiveRT.
rest/replicatortest/replicator_revtree_test.go Updates revtree tests to use peers helper and to pass supported BLIP subprotocols to active replicators.
rest/replicatortest/replicator_conflict_test.go Updates conflict tests to use peers helper and additional active node creation via AddActiveRT.
rest/replicatortest/replicator_collection_test.go Updates collection tests to use the new peers helper return type.
rest/blip_api_crud_test.go Updates BLIP CRUD test to use the new peers helper return type.

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

Comment thread rest/utilities_testing.go Outdated
Comment thread rest/utilities_testing_isgr.go Outdated
Comment thread rest/utilities_testing_isgr.go Outdated
bbrks
bbrks previously approved these changes Aug 26, 2026
torcolvin and others added 2 commits August 26, 2026 13:56
addActiveRT built extra active nodes without ISGRSupportedBLIPSubprotocols,
so in revtree subtests node 2 negotiated CBMobile_4.

A replication
reassigned to it re-pulled already-replicated docs over V4 and wrote them
as new revs, adding sequences and breaking the "exactly N changes since X"
assertions (TestReplicationHeartbeatRemoval flake). If the replication didn't get reassigend, the test would pass.

- Do a magic dance of recreating open channel for DatabaseConfig.ServerContextHasStarted and closing it after setting
  subprotocol.
- DatabaseConfig is a mutable object when adding to a Database, so removed RestTesterConfig from places in order to add the specific options.
- Now match the SyncFn and other parameters for second RestTester

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants