diff --git a/tests/ansible/integration/all.yml b/tests/ansible/integration/all.yml index 352cd630..4dd2c596 100644 --- a/tests/ansible/integration/all.yml +++ b/tests/ansible/integration/all.yml @@ -6,5 +6,6 @@ - import_playbook: action/all.yml - import_playbook: become/all.yml - import_playbook: connection_loader/all.yml -- import_playbook: runner/all.yml +- import_playbook: context_service/all.yml - import_playbook: playbook_semantics/all.yml +- import_playbook: runner/all.yml diff --git a/tests/ansible/integration/context_service/all.yml b/tests/ansible/integration/context_service/all.yml new file mode 100644 index 00000000..dc84bc0b --- /dev/null +++ b/tests/ansible/integration/context_service/all.yml @@ -0,0 +1 @@ +- import_playbook: lru_one_target.yml diff --git a/tests/ansible/integration/context_service/lru_one_target.yml b/tests/ansible/integration/context_service/lru_one_target.yml new file mode 100644 index 00000000..16fd7486 --- /dev/null +++ b/tests/ansible/integration/context_service/lru_one_target.yml @@ -0,0 +1,33 @@ +# Verify a maximum number of contexts are possible on one machine. + +- hosts: all + any_errors_fatal: true + tasks: + - name: integration/context_service/lru_one_target.yml + assert: + that: true + + - 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=21 + register: first_run + + - name: Reuse them + custom_python_detect_environment: + become: true + vars: + ansible_become_user: "mitogen__user{{item}}" + with_sequence: start=1 end=21 + register: second_run + + - assert: + that: + - first_run.results[item|int].pid == second_run.results[item|int].pid + with_items: start=0 end=20 + + - assert: + that: + - first_run.results[-1].pid != second_run.results[-1].pid