Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
The failure (in Java):
Error MessageException: ('Error while replicating', 'CouchbaseLiteException{CouchbaseLite, 5022: java.net.ConnectException: Failed to connect to /10.100.150.61:4984')Stacktraceparams_from_base_test_setup = {'base_url': 'http://10.100.150.138:8080', 'cbl_ce': False, 'cbl_db': 'cbl-test1708151226.4070559', 'cbl_log_decoder_build': None, ...} |
|
@pytest.mark.channels |
@pytest.mark.syncgateway |
@pytest.mark.attachment_cleanup |
def test_restart_sg_creating_attachments(params_from_base_test_setup):
|
""" |
https://docs.google.com/spreadsheets/d/1RrrIcIZN7MgLDlNzGWfUHo2NTYrx1Jr55SBNeCdDUQs/edit#gid=0 |
1.Have SG and CBL up and running |
2. Create docs with attachments |
3. Restart SG while documents are created |
4. verify documents are created |
5. Restart the sg while Deleting the docs |
7. verify all the attachments are deleted in the bucket |
""" |
sync_gateway_version = params_from_base_test_setup["sync_gateway_version"] |
if sync_gateway_version < "3.0.0": |
pytest.skip('This test cannot run with sg version below 3.0.0') |
|
# This test should only run when using xattr
|
|
sg_db = "db" |
sg_url = params_from_base_test_setup["sg_url"] |
sg_admin_url = params_from_base_test_setup["sg_admin_url"] |
cluster_config = params_from_base_test_setup["cluster_config"] |
sg_blip_url = params_from_base_test_setup["target_url"] |
base_url = params_from_base_test_setup["base_url"] |
cbl_db = params_from_base_test_setup["source_db"] |
need_sgw_admin_auth = params_from_base_test_setup["need_sgw_admin_auth"] |
|
auth = need_sgw_admin_auth and (RBAC_FULL_ADMIN['user'], RBAC_FULL_ADMIN['pwd']) or None |
channels = ["attachment-10"] |
db = Database(base_url)
|
sg_client = MobileRestClient()
|
|
# 1. Have CBL and SG up and running |
sg_config = params_from_base_test_setup["sg_config"] |
c = cluster.Cluster(config=cluster_config)
|
c.reset(sg_config_path=sg_config)
|
authenticator = Authenticator(base_url)
|
|
# 2. Create docs with attachment on CBL |
db.create_bulk_docs(50, "attachment-110", db=cbl_db, channels=channels, |
attachments_generator=attachment.generate_5_png_100_100)
|
|
# 3. Replicate the docs |
sg_client.create_user(sg_admin_url, sg_db, "auto10", password="password", channels=channels, auth=auth) |
cookie, session_id = sg_client.create_session(sg_admin_url, sg_db, "auto10", auth=auth) |
session = cookie, session_id
|
replicator = Replication(base_url)
|
replicator_authenticator = authenticator.authentication(session_id, cookie, authentication_type="session") |
repl_config = replicator.configure(cbl_db, sg_blip_url, continuous=True, channels=channels,
|
replication_type="push-pull", |
replicator_authenticator=replicator_authenticator)
|
repl = replicator.create(repl_config)
|
replicator.start(repl)
|
status = c.sync_gateways[0].restart(config=sg_config, cluster_config=cluster_config) |
log_info("Restarting sg ....") |
assert status == 0, "Sync_gateway did not start" |
time.sleep(19) |
> replicator.wait_until_replicator_idle(repl)
|