summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2024-07-31 20:12:31 +0200
committerGitHub <noreply@github.com>2024-07-31 20:12:31 +0200
commitbbf96c250f27b9fb69cccc8c132a56096d8cd252 (patch)
tree4e6ee4e6942d477a96c7e01e1dbe3a33c3c73a40 /test/integration
parentfix module_defaults group incorrectly giving deprecation warnings (#83510) (diff)
downloadansible-bbf96c250f27b9fb69cccc8c132a56096d8cd252.tar.xz
ansible-bbf96c250f27b9fb69cccc8c132a56096d8cd252.zip
winrm - quota retry handling (#83656)
* winrm - quota retry handling Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when starting a command. This can occur when running a loop with multiple iterations or an action plugin that runs multiple commands. * Update pywinrm constraint for test * Add verbose hint and mark test as destructive
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/connection_winrm/aliases1
-rw-r--r--test/integration/targets/connection_winrm/tests.yml17
2 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/targets/connection_winrm/aliases b/test/integration/targets/connection_winrm/aliases
index af3f193fb0..59dba60272 100644
--- a/test/integration/targets/connection_winrm/aliases
+++ b/test/integration/targets/connection_winrm/aliases
@@ -1,3 +1,4 @@
+destructive
windows
shippable/windows/group1
shippable/windows/smoketest
diff --git a/test/integration/targets/connection_winrm/tests.yml b/test/integration/targets/connection_winrm/tests.yml
index cf109a8c6c..3a117fe7ee 100644
--- a/test/integration/targets/connection_winrm/tests.yml
+++ b/test/integration/targets/connection_winrm/tests.yml
@@ -41,3 +41,20 @@
- assert:
that:
- timeout_cmd.msg == 'The win_shell action failed to execute in the expected time frame (5) and was terminated'
+
+ - name: get WinRM quota value
+ win_shell: (Get-Item WSMan:\localhost\Service\MaxConcurrentOperationsPerUser).Value
+ changed_when: false
+ register: winrm_quota
+
+ - block:
+ - name: set WinRM quota to lower value
+ win_shell: Set-Item WSMan:\localhost\Service\MaxConcurrentOperationsPerUser 3
+
+ - name: run ping with loop to exceed quota
+ win_ping:
+ loop: '{{ range(0, 4) }}'
+
+ always:
+ - name: reset WinRM quota value
+ win_shell: Set-Item WSMan:\localhost\Service\MaxConcurrentOperationsPerUser {{ winrm_quota.stdout | trim }}