You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/integration/async/runner_one_job.yml

65 lines
1.6 KiB
YAML

# Verify behaviour of a single asynchronous task, and presence of all output
# fields.
- name: integration/async/runner_one_job.yml
hosts: test-targets
any_errors_fatal: true
tasks:
# Verify output of a single async job.
- name: start 2 second op
shell: |
sleep 1;
echo alldone
async: 1000
poll: 0
register: job1
- assert:
that: |
job1.ansible_job_id and
(job1.changed == True) and
(job1.started == 1) and
(job1.changed == True) and
(job1.finished == 0)
- name: busy-poll up to 100000 times
async_status:
jid: "{{job1.ansible_job_id}}"
register: result1
until: result1.finished
retries: 100000
delay: 0
- assert:
that:
- result1.ansible_job_id == job1.ansible_job_id
- result1.attempts <= 100000
- result1.changed == True
# ansible/b72e989e1837ccad8dcdc926c43ccbc4d8cdfe44
- |
(ansible_version.full >= '2.8' and
result1.cmd == "sleep 1;\necho alldone\n") or
(ansible_version.full < '2.8' and
result1.cmd == "sleep 1;\n echo alldone")
- result1.delta|length == 14
- result1.start|length == 26
- result1.finished == 1
- result1.rc == 0
- result1.start|length == 26
- assert:
that:
- result1.stderr == ""
- result1.stderr_lines == []
- result1.stdout == "alldone"
- result1.stdout_lines == ["alldone"]
when: ansible_version.full > '2.8' # ansible#51393
- assert:
that:
- result1.failed == False
when: ansible_version.full > '2.4'