Skip to content

CBG-5620 add a test for resync - #473

Open
torcolvin wants to merge 1 commit into
mainfrom
CBG-5620
Open

CBG-5620 add a test for resync#473
torcolvin wants to merge 1 commit into
mainfrom
CBG-5620

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator

CBG-5620 add a test for resync

Adds tests for resync:

  1. test_resync_simple runs resync and validates it runs to completion and the stats are present
  2. test_resync_stop_resume tests the stop / resume behavior and stats

Helper code changes:

  • Add CouchbaseCloud.create_database function to create underlying bucket and wait for the database to exist on all Sync Gateway nodes.
  • Add CouchbaseCloud.take_db_offline function to take database offline and wait for all sync gateways to go offline
  • add resync operations
  • Database configuration produces an etag for config updates - use the etag to detect when the config has been propogated to all nodes
  • Add a batch_size to update_documents to not run into request timeouts

@torcolvin torcolvin self-assigned this Aug 12, 2026
@torcolvin
torcolvin requested a balanced review from Copilot August 12, 2026 14:51

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

Adds Sync Gateway resync coverage and supporting cluster/database utilities.

Changes:

  • Adds simple and stop/resume resync tests.
  • Adds resync, config propagation, offline, and batched-update helpers.
  • Updates topology-marker analysis and test specifications.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/dev_e2e/syncgateway/test_resync.py Adds resync tests.
spec/tests/dev_e2e/013-sync-gateway-resync.md Documents resync scenarios.
scripts/check_topology_markers.py Recognizes optional topology access.
scripts/tests/test_check_topology_markers.py Tests topology analysis.
client/src/cbltest/api/syncgatewaycluster.py Adds cluster coordination helpers.
client/src/cbltest/api/syncgateway.py Adds resync APIs and batching.
client/src/cbltest/api/cloud.py Adds direct database creation.

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

assert final_status.docs_processed >= SIMPLE_RESYNC_NUM_DOCS

@pytest.mark.asyncio(loop_scope="session")
@pytest.mark.min_sync_gateways(1)

if change_sync_function:
self.mark_test_step(f"Update the sync function for database '{db_name}'.")
await sg_cluster.round_robin_node.update_sync_function(
f"Check that the resync for database '{db_name}' processed all "
f"documents with no errors."
)
assert final_status.docs_errored == 0
index=IndexConfig(num_replicas=0),
scopes={SCOPE_NAME: ScopeConfig(collections={COLLECTION_NAME: {}})},
)
await cloud.create_database(db_name, db_config)
},
):
await self._rewrite_rev_ids(db_name, updates, scope, collection)
step = batch_size if batch_size is not None else max(len(updates), 1)
@@ -0,0 +1,77 @@
# Test Cases

## #1 test_database_visible_across_sync_gateways
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.

2 participants