Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-72319

[Tier2][automation] add debugging for test_successful_import after test was quarantined

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • CNV v4.19.0, CNV v4.20.0
    • None
    • Quality / Stability / Reliability
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • CNV Storage Sprint 279, CNV Storage Sprint 280
    • None

      following 
      https://issues.redhat.com/browse/CNV-70094
      https://issues.redhat.com/browse/CNV-72268

      following tests was quarantined

      tests.storage.cdi_import.test_import_http.test_successful_import_image
      tests.storage.cdi_import.test_import_http.test_successful_import_image
      tests.storage.cdi_import.test_import_http.test_successful_import_secure_image

      need to understand why it takes more time for this internal http to get created 

       

      Error Message
      failed on setup with "timeout_sampler.TimeoutExpiredError: Timed Out: 239.85604596138
      Function: ocp_resources.deployment.wait_for_replicas.lambda: self.instance
      Last exception: N/A."
      StacktraceTraceback (most recent call last):
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/runner.py", line 344, in from_call
      result: TResult | None = func()
      ^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/runner.py", line 246, in <lambda>
      lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/hooks.py", line 512, in __call_ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 167, in _multicall
      raise exception
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
      teardown.throw(exception)
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/capture.py", line 895, in pytest_runtest_setup return (yield)
      ^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
      res = hook_impl.function(*args)
      ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/runner.py", line 164, in pytest_runtest_setup
      item.session._setupstate.setup(item)
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/runner.py", line 514, in setup
      col.setup()
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/python.py", line 1674, in setup
      self._request._fillfixtures()
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 719, in _fillfixtures
      item.funcargs[argname] = self.getfixturevalue(argname)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 548, in getfixturevalue
      fixturedef = self._get_active_fixturedef(argname)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 639, in _get_active_fixturedef
      fixturedef.execute(request=subrequest)
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 1083, in execute
      fixturedef = request._get_active_fixturedef(argname)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 639, in _get_active_fixturedef
      fixturedef.execute(request=subrequest)
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 1127, in execute
      result = ihook.pytest_fixture_setup(fixturedef=self, request=request)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/hooks.py", line 512, in __call_ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 167, in _multicall
      raise exception
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
      teardown.throw(exception)
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/setuponly.py", line 36, in pytest_fixture_setup return (yield)
      ^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
      res = hook_impl.function(*args)
      ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 1195, in pytest_fixture_setup
      result = call_fixture_func(fixturefunc, request, kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/_pytest/fixtures.py", line 922, in call_fixture_func
      fixture_result = next(generator)
      ^^^^^^^^^^^^^^^
      File "/openshift-virtualization-tests/tests/storage/conftest.py", line 155, in internal_http_deployment
      dep.wait_for_replicas()
      File "/openshift-virtualization-tests/.venv/lib/python3.12/site-packages/ocp_resources/deployment.py", line 155, in wait_for_replicas
      

       

      The fixture internal_http_deployment fails because the Deployment’s pod never becomes Ready in default 4MiN , causing dep.wait_for_replicas() to timeout.

      need to add debug / loging to capture real reason of deployment pod 
      + need to figure out why it take too long

      previouslly tried to increase timeout but its not good approach 
      https://github.com/RedHatQE/openshift-virtualization-tests/pull/2569 

      =========

      if issue is fixed need to un-quarantined the tests from 4.19 +4.20 

      ===================================

      how to approach:

      1) check this image size if its fit or causing any issues 

      INTERNAL_HTTP_TEMPLATE = {
          "metadata": {
              "labels":
      {             "name": "internal-http",             "cdi.kubevirt.io/testing": "",         }
          },
          "spec": {
              "terminationGracePeriodSeconds": 0,
              "containers": [
                  {
                      "name": "http",
                      "image": "quay.io/openshift-cnv/qe-cnv-tests-internal-http:v1.0.0",
                      "imagePullPolicy": "Always",
                      "command": ["/usr/sbin/nginx"],
                      "readinessProbe":
      {                     "httpGet": \{"path": "/", "port": 80}
      ,
                          "initialDelaySeconds": 20,
                          "periodSeconds": 20,
                      },
                      SECURITY_CONTEXT: {"privileged": True},
                      "livenessProbe":
      {                     "httpGet": \{"path": "/", "port": 80}
      ,
                          "initialDelaySeconds": 20,
                          "periodSeconds": 20,
                      },
                  }
              ],
              "serviceAccount": CNV_TEST_SERVICE_ACCOUNT,
              "serviceAccountName": CNV_TEST_SERVICE_ACCOUNT,
          },
      }
      

       

      2)  capture the logs of the pod in this fixture, please be aware this pod is being created and deleted after it finish 

      @pytest.fixture(scope="session")
      def internal_http_deployment(cnv_tests_utilities_namespace):
          """
          Deploy internal HTTP server Deployment into the cnv_tests_utilities_namespace namespace.
          This Deployment deploys a pod that runs an HTTP server
          """
          with Deployment(
              name="internal-http",
              namespace=cnv_tests_utilities_namespace.name,
              selector=INTERNAL_HTTP_SELECTOR,
              template=INTERNAL_HTTP_TEMPLATE,
              replicas=1,
          ) as dep:
              dep.wait_for_replicas()
              yield dep

      Deployment does not have minimum availability.

      04:49:41 2025-11-11T02:49:36.184366 ocp_resources Deployment INFO Deleting {'kind': 'Deployment', 'apiVersion': 'apps/v1', 'metadata': {'name': 'internal-http', 'namespace': 'cnv-tests-utilities', 'uid': '32b2bf3d-f497-47ac-9f3a-464b70b80264', 'resourceVersion': '383898', 'generation': 1, 'creationTimestamp': '2025-11-11T02:45:34Z', 'annotations':

      {'deployment.kubernetes.io/revision': '1'}

      , 'managedFields': [{'manager': 'OpenAPI-Generator', 'operation': 'Update', 'apiVersion': 'apps/v1', 'time': '2025-11-11T02:45:34Z', 'fieldsType': 'FieldsV1', 'fieldsV1': {'f:spec': {'f:progressDeadlineSeconds': {}, 'f:replicas': {}, 'f:revisionHistoryLimit': {}, 'f:selector': {}, 'f:strategy': {'f:rollingUpdate': {'.': {}, 'f:maxSurge': {}, 'f:maxUnavailable': {}}, 'f:type': {}}, 'f:template': {'f:metadata': {'f:labels': {'.': {}, 'f:cdi.kubevirt.io/testing': {}, 'f:name': {}}}, 'f:spec': {'f:containers': {'k:

      {"name":"http"}

      ': {'.': {}, 'f:command': {}, 'f:image': {}, 'f:imagePullPolicy': {}, 'f:livenessProbe': {'.': {}, 'f:failureThreshold': {}, 'f:httpGet': {'.': {}, 'f:path': {}, 'f:port': {}, 'f:scheme': {}}, 'f:initialDelaySeconds': {}, 'f:periodSeconds': {}, 'f:successThreshold': {}, 'f:timeoutSeconds': {}}, 'f:name': {}, 'f:readinessProbe': {'.': {}, 'f:failureThreshold': {}, 'f:httpGet': {'.': {}, 'f:path': {}, 'f:port': {}, 'f:scheme': {}}, 'f:initialDelaySeconds': {}, 'f:periodSeconds': {}, 'f:successThreshold': {}, 'f:timeoutSeconds': {}}, 'f:resources': {}, 'f:securityContext': {'.': {}, 'f:privileged': {}}, 'f:terminationMessagePath': {}, 'f:terminationMessagePolicy': {}}}, 'f:dnsPolicy': {}, 'f:restartPolicy': {}, 'f:schedulerName': {}, 'f:securityContext': {}, 'f:serviceAccount': {}, 'f:serviceAccountName': {}, 'f:terminationGracePeriodSeconds': {}}}}}}, {'manager': 'kube-controller-manager', 'operation': 'Update', 'apiVersion': 'apps/v1', 'time': '2025-11-11T02:45:34Z', 'fieldsType': 'FieldsV1', 'fieldsV1': {'f:metadata': {'f:annotations': {'.': {}, 'f:deployment.kubernetes.io/revision': {}}}, 'f:status': {'f:conditions': {'.': {}, 'k:{"type":"Available"}': {'.': {}, 'f:lastTransitionTime': {}, 'f:lastUpdateTime': {}, 'f:message': {}, 'f:reason': {}, 'f:status': {}, 'f:type': {}}, 'k:{"type":"Progressing"}': {'.': {}, 'f:lastTransitionTime': {}, 'f:lastUpdateTime': {}, 'f:message': {}, 'f:reason': {}, 'f:status': {}, 'f:type': {}}}, 'f:observedGeneration': {}, 'f:replicas': {}, 'f:unavailableReplicas': {}, 'f:updatedReplicas': {}}}, 'subresource': 'status'}]}, 'spec': {'replicas': 1, 'selector': {'matchLabels': {'name': 'internal-http'}}, 'template': {'metadata': {'creationTimestamp': None, 'labels': {'cdi.kubevirt.io/testing': '', 'name': 'internal-http'}}, 'spec': {'containers': [{'name': 'http', 'image': 'quay.io/openshift-cnv/qe-cnv-tests-internal-http:v1.1.0', 'command': ['/usr/sbin/nginx'], 'resources': {}, 'livenessProbe': {'httpGet':

      {'path': '/', 'port': 80, 'scheme': 'HTTP'}

      , 'initialDelaySeconds': 20, 'timeoutSeconds': 1, 'periodSeconds': 20, 'successThreshold': 1, 'failureThreshold': 3}, 'readinessProbe': {'httpGet':

      {'path': '/', 'port': 80, 'scheme': 'HTTP'}

      , 'initialDelaySeconds': 20, 'timeoutSeconds': 1, 'periodSeconds': 20, 'successThreshold': 1, 'failureThreshold': 3}, 'terminationMessagePath': '/dev/termination-log', 'terminationMessagePolicy': 'File', 'imagePullPolicy': 'Always', 'securityContext': {'privileged': True}}], 'restartPolicy': 'Always', 'terminationGracePeriodSeconds': 0, 'dnsPolicy': 'ClusterFirst', 'serviceAccountName': 'cnv-tests-sa', 'serviceAccount': 'cnv-tests-sa', 'securityContext': {}, 'schedulerName': 'default-scheduler'}}, 'strategy': {'type': 'RollingUpdate', 'rollingUpdate': {'maxUnavailable': '25%', 'maxSurge': '25%'}}, 'revisionHistoryLimit': 10, 'progressDeadlineSeconds': 600}, 'status': {'observedGeneration': 1, 'replicas': 1, 'updatedReplicas': 1, 'unavailableReplicas': 1, 'conditions': [

      {'type': 'Available', 'status': 'False', 'lastUpdateTime': '2025-11-11T02:45:34Z', 'lastTransitionTime': '2025-11-11T02:45:34Z', 'reason': 'MinimumReplicasUnavailable', 'message': 'Deployment does not have minimum availability.'}

      , {'type': 'Progressing', 'status': 'True', 'lastUpdateTime': '2025-11-11T02:45:34Z', 'lastTransitionTime': '2025-11-11T02:45:34Z', 'reason': 'ReplicaSetUpdated', 'message': 'ReplicaSet "internal-http-7d44d6f8db" is progressing.'}]}}

              rh-ee-ahafe Ahmad Hafi
              rh-ee-ahafe Ahmad Hafi
              Jenia Peimer Jenia Peimer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: