Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default JSON size limitation #520

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/win_async-large-data-output.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- win_async - Set maximum data size allowed when deserializing async output - https://github.com/ansible-collections/ansible.windows/pull/520
1 change: 1 addition & 0 deletions plugins/modules/async_status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Try {

# TODO: move this into module_utils/powershell.ps1?
$jss = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$jss.MaxJsonLength = [int]::MaxValue
$data = $jss.DeserializeObject($data_raw)
}
Catch {
Expand Down
1 change: 1 addition & 0 deletions tests/integration/targets/win_async/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shippable/windows/group1
10 changes: 10 additions & 0 deletions tests/integration/targets/win_async/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: check that a job can deserialize large data
win_shell: '"a" * 2097152'
async: 60
register: async_large_output
no_log: true

- name: assert output can deserialize large data
assert:
that:
- async_large_output.stdout == ('a' * 2097152) + "\r\n"