File: multiple_items_loop.yml

package info (click to toggle)
python-mitogen 0.3.26-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,456 kB
  • sloc: python: 22,134; sh: 183; makefile: 74; perl: 19; ansic: 18
file content (39 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# issue #414: verify behaviour of async tasks created in a loop.

- name: integration/async/multiple_items_loop.yml
  hosts: test-targets
  tasks:

  - name: start long running ops
    become: true
    shell: "{{item}}"
    async: 15
    poll: 0
    register: jobs
    with_items:
    - "sleep 3; echo hi-from-job-1"
    - "sleep 5; echo hi-from-job-2"

  - name: Ensure static files are collected and compressed
    async_status:
      jid: "{{ item.ansible_job_id }}"
    become: yes
    register: out
    until: out is finished
    retries: 30
    with_items:
      - "{{ jobs.results }}"

  - assert:
      that:
      - out.results[0].stdout == 'hi-from-job-1'
      - out.results[0].rc == 0
      - out.results[0].delta > '0:00:03'

      - out.results[1].stdout == 'hi-from-job-2'
      - out.results[1].rc == 0
      - out.results[1].delta > '0:00:05'
      fail_msg: |
        out={{ out }}
  tags:
    - multiple_items_loop