From bb271d8d004a3ea21fd53347406e1368e4746bc8 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 20 Jan 2021 20:58:35 +0000 Subject: [PATCH] tests: Tag resource intensive tasks, to skip when strategy=linear The ansible_mitogen test suite takes over an hour when Ansible is not accelerated by Mitogen. This change aims to reduce that by skipping tests with a large number of iterations when the linear strategy is chosen. The tagged tests are intended to uncover Mitogen resource leaks. Since Mitogen is not invoked when strategy=linear, the slight reduction in test coverage is an acceptable trade off. --- .ci/azure-pipelines.yml | 1 + tests/ansible/all.yml | 1 + tests/ansible/bench/file_transfer.yml | 3 +++ tests/ansible/bench/includes.yml | 2 ++ tests/ansible/bench/loop-100-copies.yml | 5 +++++ tests/ansible/bench/loop-100-items.yml | 2 ++ tests/ansible/bench/loop-100-tasks.yml | 2 ++ tests/ansible/regression/issue_140__thread_pileup.yml | 5 +++++ tests/ansible/setup/all.yml | 1 + tests/ansible/setup/report.yml | 8 ++++++++ tests/ansible/soak/file_service.yml | 2 ++ 11 files changed, 32 insertions(+) create mode 100644 tests/ansible/setup/all.yml create mode 100644 tests/ansible/setup/report.yml diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index d436f175..397c52f3 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -30,6 +30,7 @@ jobs: MODE: localhost_ansible VER: 2.10.0 STRATEGY: linear + ANSIBLE_SKIP_TAGS: resource_intensive - job: Linux diff --git a/tests/ansible/all.yml b/tests/ansible/all.yml index e074a384..06f3acdb 100644 --- a/tests/ansible/all.yml +++ b/tests/ansible/all.yml @@ -1,3 +1,4 @@ +- include: setup/all.yml - include: regression/all.yml - include: integration/all.yml diff --git a/tests/ansible/bench/file_transfer.yml b/tests/ansible/bench/file_transfer.yml index 2ca46f1c..f6702f58 100644 --- a/tests/ansible/bench/file_transfer.yml +++ b/tests/ansible/bench/file_transfer.yml @@ -66,3 +66,6 @@ copy: src: /tmp/bigbigfile.in dest: /tmp/bigbigfile.out + + tags: + - resource_intensive diff --git a/tests/ansible/bench/includes.yml b/tests/ansible/bench/includes.yml index 4f50113a..96079874 100644 --- a/tests/ansible/bench/includes.yml +++ b/tests/ansible/bench/includes.yml @@ -2,3 +2,5 @@ tasks: - include_tasks: _includes.yml with_sequence: start=1 end=1000 + tags: + - resource_intensive diff --git a/tests/ansible/bench/loop-100-copies.yml b/tests/ansible/bench/loop-100-copies.yml index 0f4d3600..e25ae552 100644 --- a/tests/ansible/bench/loop-100-copies.yml +++ b/tests/ansible/bench/loop-100-copies.yml @@ -24,3 +24,8 @@ mode: 0644 with_filetree: /tmp/filetree.in when: item.state == 'file' + loop_control: + label: "/tmp/filetree.out/{{ item.path }}" + + tags: + - resource_intensive diff --git a/tests/ansible/bench/loop-100-items.yml b/tests/ansible/bench/loop-100-items.yml index c071c100..e711301d 100644 --- a/tests/ansible/bench/loop-100-items.yml +++ b/tests/ansible/bench/loop-100-items.yml @@ -8,3 +8,5 @@ tasks: - command: hostname with_sequence: start=1 end="{{end|default(100)}}" + tags: + - resource_intensive diff --git a/tests/ansible/bench/loop-100-tasks.yml b/tests/ansible/bench/loop-100-tasks.yml index bf6e31b8..4a76c4fe 100644 --- a/tests/ansible/bench/loop-100-tasks.yml +++ b/tests/ansible/bench/loop-100-tasks.yml @@ -110,3 +110,5 @@ - command: hostname - command: hostname - command: hostname + tags: + - resource_intensive diff --git a/tests/ansible/regression/issue_140__thread_pileup.yml b/tests/ansible/regression/issue_140__thread_pileup.yml index a9826d23..78d5c7b1 100644 --- a/tests/ansible/regression/issue_140__thread_pileup.yml +++ b/tests/ansible/regression/issue_140__thread_pileup.yml @@ -29,3 +29,8 @@ mode: 0644 with_filetree: /tmp/filetree.in when: item.state == 'file' + loop_control: + label: "/tmp/filetree.out/{{ item.path }}" + + tags: + - resource_intensive diff --git a/tests/ansible/setup/all.yml b/tests/ansible/setup/all.yml new file mode 100644 index 00000000..c51fa295 --- /dev/null +++ b/tests/ansible/setup/all.yml @@ -0,0 +1 @@ +- include: report.yml diff --git a/tests/ansible/setup/report.yml b/tests/ansible/setup/report.yml new file mode 100644 index 00000000..7ccd049a --- /dev/null +++ b/tests/ansible/setup/report.yml @@ -0,0 +1,8 @@ +- name: Report runtime settings + hosts: localhost + gather_facts: false + tasks: + - debug: {var: ansible_forks} + - debug: {var: ansible_run_tags} + - debug: {var: ansible_skip_tags} + - debug: {var: ansible_version.full} diff --git a/tests/ansible/soak/file_service.yml b/tests/ansible/soak/file_service.yml index 0640233a..65b10b2d 100644 --- a/tests/ansible/soak/file_service.yml +++ b/tests/ansible/soak/file_service.yml @@ -4,3 +4,5 @@ content: "{% for x in range(126977) %}x{% endfor %}" - include: _file_service_loop.yml with_sequence: start=1 end=100 + tags: + - resource_intensive