red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
108 stars 168 forks source link

test_unidirectional_bucketclass_replication failed with AssertionError #6752

Closed ebenahar closed 1 year ago

ebenahar commented 1 year ago

Run details:

URL: https://reportportal-ocs4.apps.ocp-c1.prod.psi.redhat.com/ui/#OCS/launches/362/6998/291593/291640/291645/log Run ID: 1669980540 Test Case: test_unidirectional_bucketclass_replication ODF Build: 4.12.0-122 OCP Version: 4.12 Job name: BAREMETAL UPI 1AZ RHCOS NVME INTEL COMPACT MODE 3M 0W tier2 Jenkins job: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster-prod/6270/ Logs URL: http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-003bu1cni30-t2/j-003bu1cni30-t2_20221202T102339/logs/

Failure Details:

Message: AssertionError
Type: None

Text:
self = <ocs_ci.ocs.resources.mcg.MCG object at 0x7fd941473730>
backingstore_name = 'azure-backingstore-4dc8ae65e03d4ff398137'
desired_state = 'OPTIMAL', timeout = 600

    def check_backingstore_state(self, backingstore_name, desired_state, timeout=600):
        """
        Checks whether the backing store reached a specific state
        Args:
            backingstore_name (str): Name of the backing store to be checked
            desired_state (str): The desired state of the backing store
            timeout (int): Number of seconds for timeout which will be used
            in the checks used in this function.

        Returns:
            bool: Whether the backing store has reached the desired state

        """

        def _check_state():
            sysinfo = self.read_system()
            for pool in sysinfo.get("pools"):
                if pool.get("name") in backingstore_name:
                    current_state = pool.get("mode")
                    logger.info(
                        f"Current state of backingstore {backingstore_name} "
                        f"is {current_state}"
                    )
                    if current_state == desired_state:
                        return True
            return False

        try:
>           for reached_state in TimeoutSampler(timeout, 10, _check_state):

ocs_ci/ocs/resources/mcg.py:830: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ocs_ci.utility.utils.TimeoutSampler object at 0x7fd8fd878c10>

    def __iter__(self):
        if self.start_time is None:
            self.start_time = time.time()
        while True:
            self.last_sample_time = time.time()
            if self.timeout <= (self.last_sample_time - self.start_time):
>               raise self.timeout_exc_cls(*self.timeout_exc_args)
E               ocs_ci.ocs.exceptions.TimeoutExpiredError: Timed out after 600s running _check_state()

ocs_ci/utility/utils.py:1173: TimeoutExpiredError

During handling of the above exception, another exception occurred:

self = <tests.manage.mcg.test_bucket_replication.TestReplication object at 0x7fd941473c70>
awscli_pod_session = <ocs_ci.ocs.resources.pod.Pod object at 0x7fd91916e8b0>
mcg_obj_session = <ocs_ci.ocs.resources.mcg.MCG object at 0x7fd8fe1716a0>
bucket_factory = <function bucket_factory_fixture.<locals>._create_buckets at 0x7fd941c38f70>
source_bucketclass = {'backingstore_dict': {'aws': [(1, 'eu-central-1')]}, 'interface': 'OC'}
target_bucketclass = {'backingstore_dict': {'azure': [(1, None)]}, 'interface': 'OC'}

    @pytest.mark.parametrize(
        argnames=["source_bucketclass", "target_bucketclass"],
        argvalues=[
            pytest.param(
                {
                    "interface": "OC",
                    "backingstore_dict": {"aws": [(1, "eu-central-1")]},
                },
                {"interface": "OC", "backingstore_dict": {"azure": [(1, None)]}},
                marks=[tier2, pytest.mark.polarion_id("OCS-2680")],
            ),
            pytest.param(
                {
                    "interface": "CLI",
                    "backingstore_dict": {"azure": [(1, None)]},
                },
                {
                    "interface": "CLI",
                    "backingstore_dict": {"aws": [(1, "eu-central-1")]},
                },
                marks=[tier2, pytest.mark.polarion_id("OCS-2684")],
            ),
            pytest.param(
                {
                    "interface": "CLI",
                    "backingstore_dict": {"aws": [(1, "eu-central-1")]},
                },
                {
                    "interface": "OC",
                    "backingstore_dict": {"gcp": [(1, None)]},
                },
                marks=[tier1],
            ),
        ],
        ids=["AWStoAZURE-BC-OC", "AZUREtoAWS-BC-CLI", "AWStoGCP-BC-Hybrid"],
    )
    def test_unidirectional_bucketclass_replication(
        self,
        awscli_pod_session,
        mcg_obj_session,
        bucket_factory,
        source_bucketclass,
        target_bucketclass,
    ):
        """
        Test unidirectional bucketclass replication using CLI and YAML

        """
>       target_bucket_name = bucket_factory(bucketclass=target_bucketclass)[0].name

tests/manage/mcg/test_bucket_replication.py:345: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:2557: in _create_buckets
    bucketclass if bucketclass is None else bucket_class_factory(bucketclass)
ocs_ci/ocs/resources/bucketclass.py:169: in _create_bucket_class
    for backingstore in backingstore_factory(
ocs_ci/ocs/resources/backingstore.py:356: in _create_backingstore
    mcg_obj.check_backingstore_state(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ocs_ci.ocs.resources.mcg.MCG object at 0x7fd941473730>
backingstore_name = 'azure-backingstore-4dc8ae65e03d4ff398137'
desired_state = 'OPTIMAL', timeout = 600

    def check_backingstore_state(self, backingstore_name, desired_state, timeout=600):
        """
        Checks whether the backing store reached a specific state
        Args:
            backingstore_name (str): Name of the backing store to be checked
            desired_state (str): The desired state of the backing store
            timeout (int): Number of seconds for timeout which will be used
            in the checks used in this function.

        Returns:
            bool: Whether the backing store has reached the desired state

        """

        def _check_state():
            sysinfo = self.read_system()
            for pool in sysinfo.get("pools"):
                if pool.get("name") in backingstore_name:
                    current_state = pool.get("mode")
                    logger.info(
                        f"Current state of backingstore {backingstore_name} "
                        f"is {current_state}"
                    )
                    if current_state == desired_state:
                        return True
            return False

        try:
            for reached_state in TimeoutSampler(timeout, 10, _check_state):
                if reached_state:
                    logger.info(
                        f"BackingStore {backingstore_name} reached state "
                        f"{desired_state}."
                    )
                    return True
                else:
                    logger.info(
                        f"Waiting for BackingStore {backingstore_name} to "
                        f"reach state {desired_state}..."
                    )
        except TimeoutExpiredError:
            logger.error(
                f"The BackingStore did not reach the desired state "
                f"{desired_state} within the time limit."
            )
>           assert False
E           AssertionError

ocs_ci/ocs/resources/mcg.py:847: AssertionError
ebenahar commented 1 year ago

This issue was encountered once again. Run details:

URL: https://reportportal-ocs4.apps.ocp-c1.prod.psi.redhat.com/ui/#OCS/launches/362/6596/271263/271264/271265/log Run ID: 1669404527 Test Case: test_multiregion_mirror ODF Build: 4.12.0-116 OCP Version: 4.12 Job name: VSPHERE6 UPI Disconnected 1AZ RHCOS VSAN 3M 3W tier4a Jenkins job: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster-prod/6134/ Logs URL: http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-001vud1cs33-t4a/j-001vud1cs33-t4a_20221125T174052/logs/ Error Message: failed on setup with "AssertionError"

ebenahar commented 1 year ago

This issue was encountered once again. Run details:

URL: https://reportportal-ocs4.apps.ocp-c1.prod.psi.redhat.com/ui/#OCS/launches/362/6539/268961/269008/269009/log Run ID: 1669152584 Test Case: test_multiregion_bucket_creation ODF Build: 4.12.0-114 OCP Version: 4.12 Job name: VSPHERE6 UPI Disconnected 1AZ RHCOS VSAN 3M 3W tier1 Jenkins job: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster-prod/6117/ Logs URL: http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-001vud1cs33-t1/j-001vud1cs33-t1_20221122T193952/logs/ Error Message: failed on setup with "AssertionError"

ebenahar commented 1 year ago

This issue was encountered once again. Run details:

URL: https://reportportal-ocs4.apps.ocp-c1.prod.psi.redhat.com/ui/#OCS/launches/362/6289/256499/256551/256553/log Run ID: 1668069131 Test Case: test_unidirectional_bucketclass_replication ODF Build: 4.12.0-91 OCP Version: 4.12 Job name: AWS IPI 3AZ RHCOS 3M 3W tier1 Jenkins job: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster-prod/6029/ Logs URL: http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-060ai3c33-t1/j-060ai3c33-t1_20221110T073408/logs/ Error Message: AssertionError

sagihirshfeld commented 1 year ago

These failed test cases have already been categorized on the Report Portal