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
|
# Verify a maximum number of contexts are possible on one machine.
- name: integration/context_service/lru_one_target.yml
hosts: test-targets
vars:
max_interps: "{{lookup('env', 'MITOGEN_MAX_INTERPRETERS')}}"
ubound: "{{max_interps|int + 1}}"
tasks:
- name: Reset all connections
mitogen_shutdown_all:
when: is_mitogen
# TODO: https://github.com/dw/mitogen/issues/696
# - name: Spin up a bunch of interpreters
# custom_python_detect_environment:
# become: true
# vars:
# ansible_become_user: "mitogen__user{{item}}"
# with_sequence: start=1 end={{ubound}}
# register: first_run
# - name: Reuse them
# custom_python_detect_environment:
# become: true
# vars:
# ansible_become_user: "mitogen__user{{item}}"
# with_sequence: start=1 end={{ubound}}
# register: second_run
# - assert:
# that:
# - first_run.results[item|int].pid == second_run.results[item|int].pid
# with_items: start=0 end={{max_interps}}
# when: is_mitogen
# - assert:
# that:
# - first_run.results[-1].pid != second_run.results[-1].pid
# when: is_mitogen
tags:
- lru_one_target
|