summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/connection_windows_ssh
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2024-03-20 20:19:52 +0100
committerGitHub <noreply@github.com>2024-03-20 20:19:52 +0100
commit8aecd1f9b22f028feaf2cb4aba3ce6baca548853 (patch)
treeaaba7e775e6ca5b36d26a9b03cf820b5778af2ef /test/integration/targets/connection_windows_ssh
parentAllow check mode async task disabling check_mode (#82827) (diff)
downloadansible-8aecd1f9b22f028feaf2cb4aba3ce6baca548853.tar.xz
ansible-8aecd1f9b22f028feaf2cb4aba3ce6baca548853.zip
winrm - Handle task timeout (#82784)
When using winrm over HTTP with message encryption enabled and a task has timed out the connection plugin will fail to cleanup the WinRM command. This will change that exception into a warning as a timeout is already an exception event and a failure to clean the operation should not override the timeout error shown.
Diffstat (limited to 'test/integration/targets/connection_windows_ssh')
-rw-r--r--test/integration/targets/connection_windows_ssh/tests.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/integration/targets/connection_windows_ssh/tests.yml b/test/integration/targets/connection_windows_ssh/tests.yml
index e9b538b40a..3b09f62036 100644
--- a/test/integration/targets/connection_windows_ssh/tests.yml
+++ b/test/integration/targets/connection_windows_ssh/tests.yml
@@ -30,3 +30,15 @@
- win_ssh_async.rc == 0
- win_ssh_async.stdout == "café\n"
- win_ssh_async.stderr == ""
+
+ # Ensures the connection plugin can handle a timeout
+ # without raising another error.
+ - name: run command with timeout
+ win_shell: Start-Sleep -Seconds 10
+ timeout: 5
+ register: timeout_cmd
+ ignore_errors: true
+
+ - assert:
+ that:
+ - timeout_cmd.msg == 'The win_shell action failed to execute in the expected time frame (5) and was terminated'