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

Flaky test_networking.test_dcos_net_cluster_identit

    Details

    • Transition Due Date:

      Description

      test-e2e/test_networking.py:12 (test_dcos_net_cluster_identity[true])
      dcos_net_cluster_identity = 'true'
      docker_backend = <dcos_e2e.backends._docker.Docker object at 0x7fbe1878c668>
      license_key_contents = 'LS0tLS1CRUdJTiBNRVNPU1BIRVJFIExJQ0VOU0UgS0VZLS0tLS0KSUQ6IG1lc29zcGhlcmUtZGV2ZWxvcGVyCgorU1VRemF0MVl2dmdVNStlaXZ2d3JOY...MKZ3ZxSVdHWUw3OXlNZldZSnNRRFFRODg4NnV2QWdZanVRaHZIcEhFNFJKbTdUUT09Ci0tLS0tRU5EIE1FU09TUEhFUkUgTElDRU5TRSBLRVktLS0tLQo='
      request = <FixtureRequest for <Function 'test_dcos_net_cluster_identity[true]'>>
      artifact_path = PosixPath('/teamcity/work/2a2d8f9cffdf706b/dcos_generate_config.ee.sh')
      log_dir = PosixPath('/teamcity/work/2a2d8f9cffdf706b/test-e2e/test-e2e-logs')
      
          @pytest.mark.parametrize('dcos_net_cluster_identity', ['true', 'false'])
          def test_dcos_net_cluster_identity(
              dcos_net_cluster_identity: str,
              docker_backend: ClusterBackend,
              license_key_contents: str,
              request: SubRequest,
              artifact_path: Path,
              log_dir: Path,
          ) -> None:
              """
              Test the correct cluster identity depending on the cluster configuration.
              In case of 'false', cluster identity should be 'minuteman' and in case of
              'true', cluster identity should be equal to cluster_id
              """
              superuser_username = str(uuid.uuid4())
              superuser_password = str(uuid.uuid4())
              config = {
                  'superuser_username': superuser_username,
                  # We can hash the password with any `passlib`-based method here.
                  # We choose `sha512_crypt` arbitrarily.
                  'superuser_password_hash': sha512_crypt.hash(superuser_password),
                  'dcos_net_cluster_identity': dcos_net_cluster_identity,
                  'fault_domain_enabled': 'false',
                  'license_key_contents': license_key_contents,
              }
          
              with Cluster(cluster_backend=docker_backend) as cluster:
          
                  cluster.install_dcos_from_path(
                      dcos_installer=artifact_path,
                      dcos_config={
                          **cluster.base_config,
                          **config,
                      },
                      output=Output.LOG_AND_CAPTURE,
                      ip_detect_path=docker_backend.ip_detect_path,
                  )
          
                  wait_for_dcos_ee(
                      cluster=cluster,
                      superuser_username=superuser_username,
                      superuser_password=superuser_password,
                      request=request,
                      log_dir=log_dir,
                  )
          
                  environment_variables = {
                      'DCOS_LOGIN_UNAME': superuser_username,
                      'DCOS_LOGIN_PW': superuser_password,
                  }
          
                  pytest_command = [
                      'pytest',
                      '-vvv',
                      '-s',
                      '-x',
                      'open_source_tests/test_networking.py::test_dcos_net_cluster_identity',
                  ]
          
                  cluster.run_integration_tests(
                      pytest_command=pytest_command,
                      env=environment_variables,
      >               output=Output.LOG_AND_CAPTURE,
                  )
      
      test_networking.py:75: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      ../env/lib/python3.5/site-packages/dcos_e2e/cluster.py:589: in run_integration_tests
          transport=transport,
      ../env/lib/python3.5/site-packages/dcos_e2e/node.py:498: in run
          capture_output=capture_output,
      ../env/lib/python3.5/site-packages/dcos_e2e/_node_transports/_docker_exec_transport.py:128: in run
          pipe_output=capture_output,
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      
      args = ['docker', 'exec', '--user', 'root', '--env', 'DCOS_NUM_MASTERS=1', ...]
      log_output_live = True, cwd = None, env = None, pipe_output = True
      
          def run_subprocess(
              args: List[str],
              log_output_live: bool,
              cwd: Optional[Union[bytes, str]] = None,
              env: Optional[Dict[str, str]] = None,
              pipe_output: bool = True,
          ) -> CompletedProcess:
              """
              Run a command in a subprocess.
          
              Args:
                  args: See :py:func:`subprocess.run`.
                  log_output_live: If `True`, log output live. If `True`, stderr is
                      merged into stdout in the return value.
                  cwd: See :py:func:`subprocess.run`.
                  env: See :py:func:`subprocess.run`.
                  pipe_output: If ``True``, pipes are opened to stdout and stderr.
                      This means that the values of stdout and stderr will be in
                      the returned ``subprocess.CompletedProcess`` and optionally
                      sent to a logger, given ``log_output_live``.
                      If ``False``, no output is sent to a logger and the values are
                      not returned.
          
              Returns:
                  See :py:func:`subprocess.run`.
          
              Raises:
                  subprocess.CalledProcessError: See :py:func:`subprocess.run`.
                  Exception: An exception was raised in getting the output from the call.
              """
              process_stdout = PIPE if pipe_output else None
              process_stderr = PIPE if pipe_output else None
          
              # It is hard to log output of both stdout and stderr live unless we
              # combine them.
              # See http://stackoverflow.com/a/18423003.
              if log_output_live:
                  process_stderr = STDOUT
          
              with Popen(
                  args=args,
                  cwd=cwd,
                  stdout=process_stdout,
                  stderr=process_stderr,
                  env=env,
              ) as process:
                  try:
                      if log_output_live:
                          stdout = b''
                          stderr = b''
                          for line in process.stdout:
                              log_message = _safe_decode(line.rstrip())
                              LOGGER.debug(log_message)
                              stdout += line
                          # stderr/stdout are not readable anymore which usually means
                          # that the child process has exited. However, the child
                          # process has not been wait()ed for yet, i.e. it has not yet
                          # been reaped. That is, its exit status is unknown. Read its
                          # exit status.
                          process.wait()
                      else:
                          stdout, stderr = process.communicate()
                  except Exception:  # pragma: no cover
                      # We clean up if there is an error while getting the output.
                      # This may not happen while running tests so we ignore coverage.
          
                      # Attempt to give the subprocess(es) a chance to terminate.
                      process.terminate()
                      try:
                          process.wait(1)
                      except subprocess.TimeoutExpired:
                          # If the process cannot terminate cleanly, we just kill it.
                          process.kill()
                      raise
                  if stderr:
                      if process.returncode == 0:
                          log = LOGGER.warning
                          log(repr(args))
                      else:
                          log = LOGGER.error
                      for line in stderr.rstrip().split(b'\n'):
                          log_message = _safe_decode(line.rstrip())
                          log(log_message)
                  if process.returncode != 0:
                      raise subprocess.CalledProcessError(
                          returncode=process.returncode,
                          cmd=args,
                          output=stdout,
      >                   stderr=stderr,
                      )
      E               subprocess.CalledProcessError: Command '['docker', 'exec', '--user', 'root', '--env', 'DCOS_NUM_MASTERS=1', '--env', 'DCOS_LOGIN_UNAME=a70024f5-7fe1-4463-bb93-ca461d52258e', '--env', 'MASTER_HOSTS=172.17.0.2', '--env', 'PUBLIC_MASTER_HOSTS=172.17.0.2', '--env', 'SLAVE_HOSTS=172.17.0.3', '--env', 'DCOS_DNS_ADDRESS=http://172.17.0.2', '--env', 'PUBLIC_SLAVE_HOSTS=172.17.0.4', '--env', 'DCOS_NUM_AGENTS=2', '--env', 'DCOS_LOGIN_PW=0646bf08-e41b-4cd0-b00d-e74493203c8a', 'daa798a0eccd26d3ddf09c7bf8fc3bf778ec17a2d8403bf16ba741641956daf8', '/bin/sh', '-c', '. /opt/mesosphere/environment.export && cd /opt/mesosphere/active/dcos-integration-test/ && pytest -vvv -s -x open_source_tests/test_networking.py::test_dcos_net_cluster_identity']' returned non-zero exit status 1
      
      ../env/lib/python3.5/site-packages/dcos_e2e/_common.py:150: CalledProcessError
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: