Conversation
Contributor
There was a problem hiding this comment.
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 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CBG-5620 add a test for resync
Adds tests for resync:
test_resync_simpleruns resync and validates it runs to completion and the stats are presenttest_resync_stop_resumetests the stop / resume behavior and statsHelper code changes:
CouchbaseCloud.create_databasefunction to create underlying bucket and wait for the database to exist on all Sync Gateway nodes.CouchbaseCloud.take_db_offlinefunction to take database offline and wait for all sync gateways to go offline