Skip to content

Commit

Permalink
Makes testinfra SSH calls more resilient
Browse files Browse the repository at this point in the history
The config test suite passes locally against the AWS scenario reliably;
in CI, however, there are sporadic connectivity issues. Let's instruct
testinfra to retry failed connections, to make sure the tests are
running well.
  • Loading branch information
Conor Schaefer committed Aug 8, 2018
1 parent fbc4b64 commit 041d7b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions molecule/testinfra/staging/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ def export_ci_var_overrides():
os.environ['APP_IP'] = app_ip
os.environ['MON_IP'] = mon_ip

# Make SSH calls more resilient, as we're operating against remote hosts,
# and running from CI. We've observed flakey connections in CI at times.
os.environ['ANSIBLE_SSH_RETRIES'] = '5'
ssh_args = [
"-o ConnectTimeout=60s",
"-o ControlMaster=auto",
"-o ControlPersist=180s",
"-o StrictHostKeyChecking=no",
]
os.environ['ANSIBLE_SSH_ARGS'] = " ".join(ssh_args)


def lookup_aws_private_address(molecule_info, hostname):
"""
Expand Down

0 comments on commit 041d7b1

Please sign in to comment.