Skip to content

Commit

Permalink
Fix issues with ansible-playbook-callbacks test
Browse files Browse the repository at this point in the history
The timing of the async tasks was a little unpredictable, meaning that
sometimes we would get an unexpected number of v2_runner_on_async_poll
callbacks, and fail the test. This change fixes the issue by increasing
the poll interval to 2 seconds and the sleep to 3 seconds, such that on
a reasonable responsive system we will poll twice per task.

The include_me.yml file does not exist in this integration test.

The remote_tmp_dir.path expression is invalid - the setup_remote_tmp_dir
role uses set_fact to set remote_tmp_dir to remote_tmp_dir.path.

The integration tests run with ANSIBLE_HOST_PATTERN_MISMATCH=error,
meaning that the final play was never reached. Remove the play with the
invalid host pattern.
  • Loading branch information
markgoddard committed Dec 12, 2023
1 parent a9919dd commit 8c5bd40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,22 @@
ignore_errors: true

- name: async poll ok
command: sleep 2
async: 3
poll: 1
command: sleep 3
async: 5
poll: 2

- name: async poll failed
shell: sleep 2; false
async: 3
poll: 1
shell: sleep 3; false
async: 5
poll: 2
ignore_errors: true

- include_tasks: include_me.yml

- name: diff
copy:
content: diff
dest: '{{ remote_tmp_dir.path }}/diff.txt'
dest: '{{ remote_tmp_dir }}/diff.txt'
diff: true

- hosts: i_dont_exist

- hosts: localhost
gather_facts: false
max_fail_percentage: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
1 __init__
83 v2_on_any
87 v2_on_any
1 v2_on_file_diff
4 v2_playbook_on_handler_task_start
2 v2_playbook_on_include
3 v2_playbook_on_notify
1 v2_playbook_on_play_start
2 v2_playbook_on_play_start
1 v2_playbook_on_start
1 v2_playbook_on_stats
17 v2_playbook_on_task_start
18 v2_playbook_on_task_start
1 v2_playbook_on_vars_prompt
1 v2_runner_item_on_failed
2 v2_runner_item_on_ok
Expand All @@ -17,6 +18,6 @@
5 v2_runner_on_failed
15 v2_runner_on_ok
1 v2_runner_on_skipped
21 v2_runner_on_start
22 v2_runner_on_start
1 v2_runner_on_unreachable
2 v2_runner_retry

0 comments on commit 8c5bd40

Please sign in to comment.