Uploaded image for project: 'DC/OS'
  1. DC/OS
  2. DCOS_OSS-4682

Metrics tests (test_metrics_containers) fail on expected 204 from v0 metrics API

    Details

    • Sprint:
      Observability Team Sprint 37
    • Story Points:
      3
    • Transition Due Date:

      Description

      The get_container_metrics() function will raise an exception and retry if it gets a 204 from the v0 metrics API's /containers/<container-id> endpoint. The problem is that a 204 is not necessarily worth a retry – sometimes the requested metrics aren't expected to exist (perhaps because the metrics are for a container from an unrelated test, and it has not been running for some time).

      dcos_api_session = <dcos_test_utils.dcos_api.DcosApiSession object at 0x7fcd54530710>
      node = '10.10.0.63', container_id = '368d7561-ab76-44e1-b146-8f19499c5dd4'
      
          @retrying.retry(wait_fixed=METRICS_INTERVAL, stop_max_delay=METRICS_WAITTIME)
          def get_container_metrics(dcos_api_session, node: str, container_id: str):
              """Return container_id's metrics from the metrics API on node.
          
              Retries on error, non-200 status, or missing response fields for up
              to 5 minutes.
          
              """
              response = dcos_api_session.metrics.get('/containers/' + container_id, node=node)
      >       assert response.status_code == 200
      E       assert 204 == 200
      E        +  where 204 = <Response [204]>.status_code
      
      test_metrics.py:514: AssertionError
      

        Attachments

          Activity

            People

            • Assignee:
              branden Branden Rolston
              Reporter:
              branden Branden Rolston
              Team:
              Observability Team
              Watchers:
              Alex Rukletsov, Branden Rolston, Charles Provencher, Deepak Goel, Dima Rozhkov, Gastón Kleiman, Gauri Powale, Gilbert Song, Greg Mann, Gustav Paul, Jan-Philip Gehrcke, Jonathan Giddy, Julian Gieseke, Lee Hambley (Inactive), Matthias Eichstedt, Mergebot, Orlando Hohmeier, Philip Norman, Senthil Kumaran, Sergey Urbanovich, Till Toenshoff, Tim Weidner
            • Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: