red-hat-storage / ocs-ci

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

test_pvc_clone_performance.py - fails in 4.14 - a fix is needed #8486

Closed ypersky1980 closed 1 year ago

ypersky1980 commented 1 year ago

test_pvc_clone_performance.py all test cases failed on both AWS and VMware LSO platforms while running on 4.14.

The test passed in 4.13 on all the platforms.

VMware LSO: https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/job/qe-deploy-ocs-cluster/28837/testReport/ AWS https://ocs4-jenkins-csb-odf-qe.apps.ocp-c1.prod.psi.redhat.com/view/Performance/job/qe-trigger-aws-ipi-3az-rhcos-3m-3w-performance/101/testReport/

ypersky1980 commented 1 year ago

Error for single clone creation:

TestPVCClonePerformance.test_clone_create_deleteperformance[CephBlockPool-1-600Mi]

self = <test_pvc_clone_performance.TestPVCClonePerformance object at 0x7f76786fce80> secret_factory = <function secret_factory_fixture..factory at 0x7f7654106d30> interface_type = 'CephBlockPool', pvc_size = '1', file_size = '600Mi'

@pytest.mark.parametrize(
    argnames=["interface_type", "pvc_size", "file_size"],
    argvalues=[
        pytest.param(
            *[constants.CEPHBLOCKPOOL, "1", "600Mi"],
            marks=pytest.mark.polarion_id("OCS-2356"),
        ),
        pytest.param(
            *[constants.CEPHBLOCKPOOL, "25", "15Gi"],
            marks=pytest.mark.polarion_id("OCS-2340"),
        ),
        pytest.param(
            *[constants.CEPHBLOCKPOOL, "50", "30Gi"],
            marks=pytest.mark.polarion_id("OCS-2357"),
        ),
        pytest.param(
            *[constants.CEPHBLOCKPOOL, "100", "60Gi"],
            marks=pytest.mark.polarion_id("OCS-2358"),
        ),
        pytest.param(
            *[constants.CEPHFILESYSTEM, "1", "600Mi"],
            marks=pytest.mark.polarion_id("2341"),
        ),
        pytest.param(
            *[constants.CEPHFILESYSTEM, "25", "15Gi"],
            marks=pytest.mark.polarion_id("2355"),
        ),
        pytest.param(
            *[constants.CEPHFILESYSTEM, "50", "30Gi"],
            marks=pytest.mark.polarion_id("2359"),
        ),
        pytest.param(
            *[constants.CEPHFILESYSTEM, "100", "60Gi"],
            marks=pytest.mark.polarion_id("2360"),
        ),
    ],
)
def test_clone_create_delete_performance(
    self, secret_factory, interface_type, pvc_size, file_size
):
    """
    Write data (60% of PVC capacity) to the PVC created in setup
    Create clones for an existing pvc,
    Measure clones average creation time and speed
    Delete the created clone
    Measure clone average deletion time and speed
    Note: by increasing max_num_of_clones value you increase number of the clones to be created/deleted
    """

    # Initialize some variabels
    self.interface = interface_type
    self.timeout = 18000
    self.pvc_size = pvc_size
    self.results_path = get_full_test_logs_path(cname=self)
    file_size_mb = convert_device_size(file_size, "MB")
    # Initialize the results doc file.
    full_results = self.init_full_results(
        ClonesResultsAnalyse(
            self.uuid,
            self.crd_data,
            self.full_log_path,
            "pvc_clone_performance",
        )
    )

    test_start_time = self.get_time()

    # Create new pool and sc only for RBD, for CepgFS use thr default
    if self.interface == constants.CEPHBLOCKPOOL:
        # Creating new pool to run the test on it
        self.create_new_pool_and_sc(secret_factory)
    else:
        self.sc_obj = ocs.OCS(
            kind="StorageCluster",
            metadata={
                "namespace": self.namespace,
                "name": Interfaces_info[self.interface]["sc"],
            },
        )
        self.pool_name = "ocs-storagecluster-cephfilesystem"
    # Create a PVC
    self.create_pvc_and_wait_for_bound()
    # Create a POD
    self.create_pod_and_wait_for_completion(filesize=f"{file_size_mb}M")
    # taking the time, so parsing the provision log will be faster.
    start_time = self.get_time("csi")
    self.clones_list = self.create_and_delete_clones()

    # Mesure Creation / Deletion time of all clones
    results_times = performance_lib.get_pvc_provision_times(
        interface=self.interface,
        pvc_name=self.clones_list,
        start_time=start_time,
    )

    test_end_time = self.get_time()

    logger.info(
        f"Printing clone creation time and speed for {self.number_of_clones} clones "
        f"on {self.interface} PVC of size {self.pvc_size} GB:"
    )
    # Produce ES report
    speed = True if self.interface == constants.CEPHFILESYSTEM else False
  full_results.analyse_results(

results_times, total_data=file_size_mb, speed=speed )

tests/e2e/performance/csi_tests/test_pvc_clone_performance.py:380:


tests/e2e/performance/csi_tests/test_pvc_clone_performance.py:81: in analyse_results avg_data[op] = statistics.mean(all_data[op])


data = []

def mean(data):
    """Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    """
    if iter(data) is data:
        data = list(data)
    n = len(data)
    if n < 1:
      raise StatisticsError('mean requires at least one data point')

E statistics.StatisticsError: mean requires at least one data point

/usr/lib64/python3.8/statistics.py:315: StatisticsError =============================== warnings summary =============================== tests/e2e/performance/csi_tests/test_pvc_clone_performance.py::TestPVCClonePerformance::test_clone_create_delete_performance[CephBlockPool-1-600Mi] /home/ypersky/ypersky-git/yulienv38/lib64/python3.8/site-packages/elasticsearch/connection/base.py:208: ElasticsearchWarning: Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html to enable security. warnings.warn(message, category=ElasticsearchWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html =========================== short test summary info ============================

ypersky1980 commented 1 year ago

For all the clones:

21:15:14 - MainThread - ocs_ci.utility.utils - INFO - Executing command: oc -n namespace-pas-test-3d240927049a412da4877 delete PersistentVolumeClaim clone-pas-test-11 21:15:15 - MainThread - test_pvc_clone_performance - INFO - Deletion of clone number 11 , the clone name is clone-pas-test-11. 21:15:15 - MainThread - ocs_ci.utility.utils - INFO - Executing command: oc --kubeconfig /home/ypersky/ypersky-clusters/ibmcloud/ypersky-414i/auth/kubeconfig -n namespace-pas- test-3d240927049a412da4877 get PersistentVolumeClaim clone-pas-test-11 -n namespace-pas-test-3d240927049a412da4877 -o yaml 21:15:16 - MainThread - ocs_ci.utility.utils - WARNING - Command stderr: Error from server (NotFound): persistentvolumeclaims "clone-pas-test-11" not found

21:15:16 - MainThread - ocs_ci.ocs.ocp - WARNING - Failed to get resource: clone-pas-test-11 of kind: PersistentVolumeClaim, selector: None, Error: Error during execution of c ommand: oc --kubeconfig /home/ypersky/ypersky-clusters/ibmcloud/ypersky-414i/auth/kubeconfig -n namespace-pas-test-3d240927049a412da4877 get PersistentVolumeClaim clone-pas-tes t-11 -n namespace-pas-test-3d240927049a412da4877 -o yaml. Error is Error from server (NotFound): persistentvolumeclaims "clone-pas-test-11" not found

21:15:16 - MainThread - ocs_ci.ocs.ocp - WARNING - Number of attempts to get resource reached! 21:15:16 - MainThread - ocs_ci.ocs.ocp - INFO - PersistentVolumeClaim clone-pas-test-11 got deleted successfully

21:15:24 - MainThread - test_pvc_clone_performance - INFO - Test report for clone clone-pas-test-8 : 21:15:24 - MainThread - test_pvc_clone_performance - INFO - Createion time is : 3.666 Secounds 21:15:24 - MainThread - test_pvc_clone_performance - INFO - Csi_createion time is : 3.648 Secounds 21:15:24 - MainThread - test_pvc_clone_performance - INFO - Deleteion time is : None Secounds 21:15:24 - MainThread - test_pvc_clone_performance - WARNING - There is no Deleteion time ! 21:15:24 - MainThread - test_pvc_clone_performance - INFO - Csi_deleteion time is : 0.596 Secounds

ypersky1980 commented 1 year ago

The PVC and the clones DO EXIST prior to the deletion :

(yulienv38) [ypersky@ypersky ocs-ci]$ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE clone-pas-test-1 Bound pvc-ecd80c5a-5acc-4a77-9a4c-08af71d1b1f7 1Gi RWO pas-test-pool-rbd 4m30s clone-pas-test-10 Bound pvc-aaf05f10-5b31-4455-bf7f-06079a8bca2c 1Gi RWO pas-test-pool-rbd 2m53s clone-pas-test-11 Bound pvc-5a4d8a87-f66f-4a8c-9578-706c9826a447 1Gi RWO pas-test-pool-rbd 2m43s clone-pas-test-2 Bound pvc-44ed8ff6-0512-4604-9b4a-edf42aca1be1 1Gi RWO pas-test-pool-rbd 4m20s clone-pas-test-3 Bound pvc-8f874180-8cc7-43e6-a8a7-5f547ecd8404 1Gi RWO pas-test-pool-rbd 4m10s clone-pas-test-4 Bound pvc-79422cc2-2919-4438-9cd3-95e5ea9c02c1 1Gi RWO pas-test-pool-rbd 3m59s clone-pas-test-5 Bound pvc-1ac7b153-fc2d-48af-83b6-273f8159f44a 1Gi RWO pas-test-pool-rbd 3m48s clone-pas-test-6 Bound pvc-7b6138bd-7739-4c8f-9f8f-c19477e4ba90 1Gi RWO pas-test-pool-rbd 3m33s clone-pas-test-7 Bound pvc-2f56eb67-8bb6-46d6-96e7-ab6663e2ef02 1Gi RWO pas-test-pool-rbd 3m23s clone-pas-test-8 Bound pvc-c04aa783-27cd-41e5-8bb0-48af0d44cde0 1Gi RWO pas-test-pool-rbd 3m13s clone-pas-test-9 Bound pvc-1cf561de-33e3-48ea-8520-4c06cb7c7ed1 1Gi RWO pas-test-pool-rbd 3m3s pvc-pas-test Bound pvc-d0c888ab-94c5-41a8-8691-4d422214ccd1 1Gi RWO pas-test-pool-rbd 5m20s

ypersky1980 commented 1 year ago

https://github.com/red-hat-storage/ocs-ci/pull/8657 - PR with a fix

ypersky1980 commented 1 year ago

The problem was that the "end of deletion" row has changed in 4.14. The code was changed accordingly, to support both ODF <=4.13 and ODF 4.14.