Skip to content

Commit 05d98e5

Browse files
committed
tests: Speed up ssh timeout tests
1 parent 0ce9ffc commit 05d98e5

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

docs/ansible_detailed.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ Noteworthy Differences
247247
part of the core library, and should therefore be straightforward to fix as
248248
part of 0.2.x.
249249

250+
* Connection and become timeouts are applied differently. Mitogen may consider
251+
a connection to have timed out, when Ansible would have waited longer or
252+
indefinately. For example if SSH authentication completes within the
253+
timeout, but execution of login scripts exceeds it - then Mitogen will
254+
consider the task to have timed out and that host to have failed.
255+
256+
..
257+
tests/ansible/integration/ssh/timeouts.yml covers (some of) this behaviour.
258+
250259
..
251260
* SSH and ``become`` are treated distinctly when applying timeouts, and
252261
timeouts apply up to the point when the new interpreter is ready to accept

tests/ansible/integration/ssh/timeouts.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Ensure 'ssh' connections time out correctly.
2+
# mitogen__slow_user performs a long sleep in ~/.profile.
3+
# Mitogen counts this time towards the connection timeout. Ansible doesn't.
4+
# ansible_python_interpreter=python3000 is an optimisation, to avoid waiting
5+
# on the timeout multiple times (e.g. interpreter discovery).
26

37
- name: integration/ssh/timeouts.yml
48
hosts: test-targets
9+
gather_facts: false
510
tasks:
611
- include_tasks: ../_mitogen_only.yml
712

@@ -17,6 +22,7 @@
1722
test-targets
1823
-m custom_python_detect_environment
1924
-e ansible_user=mitogen__slow_user -e ansible_password=slow_user_password
25+
-e ansible_python_interpreter=python3000
2026
args:
2127
chdir: ../..
2228
register: out

tests/ansible/integration/ssh/variables.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
test-targets
4444
-e ansible_ssh_user=mitogen__has_sudo
4545
-e ansible_ssh_pass=wrong_password
46+
-e ansible_python_interpreter=python3000
4647
args:
4748
chdir: ../..
4849
register: out
@@ -82,6 +83,7 @@
8283
test-targets
8384
-e ansible_user=mitogen__has_sudo
8485
-e ansible_ssh_pass=wrong_password
86+
-e ansible_python_interpreter=python3000
8587
args:
8688
chdir: ../..
8789
register: out
@@ -121,6 +123,7 @@
121123
test-targets
122124
-e ansible_user=mitogen__has_sudo
123125
-e ansible_password=wrong_password
126+
-e ansible_python_interpreter=python3000
124127
args:
125128
chdir: ../..
126129
register: out
@@ -165,6 +168,7 @@
165168
test-targets
166169
-e ansible_user=mitogen__has_sudo
167170
-e ansible_ssh_private_key_file=/dev/null
171+
-e ansible_python_interpreter=python3000
168172
args:
169173
chdir: ../..
170174
register: out

0 commit comments

Comments
 (0)