File: forking_active.yml

package info (click to toggle)
python-mitogen 0.3.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,708 kB
  • sloc: python: 24,457; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (35 lines) | stat: -rw-r--r-- 857 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
- name: integration/runner/forking_active.yml
  hosts: test-targets
  tasks:
  - include_tasks: ../_mitogen_only.yml

  # Verify mitogen_task_isolation=fork triggers forking.

  - name: get regular process ID.
    custom_python_detect_environment:
    register: sync_proc1

  - name: get force-forked process ID.
    custom_python_detect_environment:
    register: fork_proc1
    vars:
      mitogen_task_isolation: fork

  - name: get force-forked process ID again.
    custom_python_detect_environment:
    register: fork_proc2
    vars:
      mitogen_task_isolation: fork

  - assert:
      that:
      - fork_proc1.pid != sync_proc1.pid
      - fork_proc1.pid != fork_proc2.pid
      fail_msg: |
        fork_proc1={{ fork_proc1 }}
        sync_proc1={{ sync_proc1 }}
        fork_proc2={{ fork_proc2 }}

  tags:
    - forking_active
    - mitogen_only