File: issue_140__thread_pileup.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 (55 lines) | stat: -rw-r--r-- 1,424 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# issue #140: with_filetree use caused unbounded (>500) thread growth in target
# interpreter. No easy hook to check thread count, but doing a 1000 item
# with_items should crash for other reasons (RAM, file descriptor count, ..)

- name: regression/issue_140__thread_pileup.yml
  hosts: test-targets
  tasks:

  - name: Create file tree
    connection: local
    run_once: true
    vars:
      ansible_python_interpreter: "{{ ansible_playbook_python }}"
    shell: >
      mkdir /tmp/filetree.in;
      seq -f /tmp/filetree.in/%g 1 1000 | xargs touch;
    args:
      creates: /tmp/filetree.in

  - name: Delete remote file tree
    file: path=/tmp/filetree.out state=absent

  - name: Recreate file tree
    file:
      state: directory
      path: /tmp/filetree.out
      mode: u=rwx,go=rx

  - name: Trigger nasty process pileup
    copy:
      src: "{{item.src}}"
      dest: "/tmp/filetree.out/{{item.path}}"
      mode: u=rw,go=r
    with_filetree: /tmp/filetree.in
    when: item.state == 'file'
    loop_control:
      label: "/tmp/filetree.out/{{ item.path }}"

  - name: Cleanup local file tree
    connection: local
    run_once: true
    vars:
      ansible_python_interpreter: "{{ ansible_playbook_python }}"
    file:
      path: /tmp/filetree.in
      state: absent

  - name: Cleanup remote file tree
    file:
      path: /tmp/filetree.out
      state: absent

  tags:
  - resource_intensive
  - issue_140