Uploaded image for project: 'Couchbase Mobile'
  1. Couchbase Mobile
  2. CM-648

estsuites.CBLTester.CBL_Functional_tests.TestSetup_FunctionalTests.test_replication.test_replication_configuration_valid_values[100-True-False]

    XMLWordPrintable

Details

    Description

      Error Message

      AssertionError: total is not equal to completed assert 22914 == 22916 -22914 +22916

      Stacktrace

      params_from_base_test_setup =

      {'base_url': 'http://10.100.174.59:8080', 'cbl_ce': False, 'cbl_db': 'cbl-test1607509014.947896', 'cbl_log_decoder_build': None, ...}

      num_of_docs = 100, continuous = True, x509_cert_auth = False

      @pytest.mark.listener
      @pytest.mark.replication
      @pytest.mark.parametrize("num_of_docs, continuous, x509_cert_auth", [
      pytest.param(10, True, True, marks=pytest.mark.sanity),
      (100, True, False),
      (1000, True, True)
      ])
      def test_replication_configuration_valid_values(params_from_base_test_setup, num_of_docs, continuous, x509_cert_auth):
      """
      @summary:
      1. Create CBL DB and create bulk doc in CBL
      2. Configure replication with valid values of valid cbl Db, valid target url
      3. Start replication with push and pull
      4. Verify replication is successful and verify docs exist
      """
      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"]
      sg_config = params_from_base_test_setup["sg_config"]
      db = params_from_base_test_setup["db"]
      cbl_db = params_from_base_test_setup["source_db"]
      mode = params_from_base_test_setup["mode"]
      sync_gateway_version = params_from_base_test_setup["sync_gateway_version"]

      if sync_gateway_version < "2.0.0":
      pytest.skip('This test cannot run with sg version below 2.0')
      channels_sg = ["ABC"]
      username = "autotest"
      password = "password"
      number_of_updates = 2

      1. Create CBL database
        sg_client = MobileRestClient()
      1. Reset cluster to ensure no data in system
        if x509_cert_auth:
        temp_cluster_config = copy_to_temp_conf(cluster_config, mode)
        persist_cluster_config_environment_prop(temp_cluster_config, 'x509_certs', True)
        cluster_config = temp_cluster_config
        c = cluster.Cluster(config=cluster_config)
        c.reset(sg_config_path=sg_config)

      db.create_bulk_docs(num_of_docs, "cbl", db=cbl_db, channels=channels_sg)

      1. Configure replication with push_pull
        replicator = Replication(base_url)
        sg_client.create_user(sg_admin_url, sg_db, username, password, channels=channels_sg)
        session, replicator_authenticator, repl = replicator.create_session_configure_replicate(
        base_url, sg_admin_url, sg_db, username, password, channels_sg, sg_client, cbl_db, sg_blip_url, continuous=continuous, replication_type="push_pull")

      sg_docs = sg_client.get_all_docs(url=sg_url, db=sg_db, auth=session)
      sg_client.update_docs(url=sg_url, db=sg_db, docs=sg_docs["rows"], number_updates=number_of_updates, auth=session)
      replicator.wait_until_replicator_idle(repl)
      total = replicator.getTotal(repl)
      completed = replicator.getCompleted(repl)
      > assert total == completed, "total is not equal to completed"
      E AssertionError: total is not equal to completed
      E assert 22914 == 22916
      E -22914
      E +22916

      testsuites/CBLTester/CBL_Functional_tests/TestSetup_FunctionalTests/test_replication.py:102: AssertionError

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            manasa.ghanta Manasa Ghanta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty