File: runner_timeout_then_polling.yml

package info (click to toggle)
python-mitogen 0.3.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,456 kB
  • sloc: python: 22,134; sh: 183; makefile: 74; perl: 19; ansic: 18
file content (36 lines) | stat: -rw-r--r-- 942 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
# Verify 'async: <timeout>' functions as desired.

- name: integration/async/runner_timeout_then_polling.yml
  hosts: test-targets
  tasks:
  - include_tasks: ../_mitogen_only.yml

  # Verify async-with-timeout-then-poll behaviour.
  # This is semi-broken in upstream Ansible, it does not bother to update the
  # job file on failure. So only test on Mitogen.

  - name: sleep for 7 seconds, but timeout after 1 second.
    shell: sleep 10
    async: 1
    poll: 0
    register: job

  - name: busy-poll up to 500 times
    async_status:
      jid: "{{job.ansible_job_id}}"
    register: result
    until: result is finished
    retries: 500
    delay: 0
    ignore_errors: true

  - assert:
      that:
        - result.failed == 1
        - result.finished == 1
        - result.msg == "Job reached maximum time limit of 1 seconds."
      fail_msg: |
        result={{ result }}
  tags:
    - mitogen_only
    - runner_timeout_then_polling