Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection test flake due to successful canceled command #14519

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

AlanCoding
Copy link
Member

SUMMARY

This took some frustration to get to the root of.

- name: Wait for the command to exit on cancel
  ad_hoc_command_wait:
    command_id: "{{ command.id }}"
  register: wait_results
  ignore_errors: true

- assert:
    that:
      - wait_results is successful
      - 'wait_results.status == "successful"'

Think about that for a second. The job (ad hoc command) is canceled, and it's status is successful... how did this ever pass?

It appears to be a race condition where our cancel logic is so slow that the command completed before the cancel took effect. If it ever too too long to dispatch the command (or something like that) the test would fail. Looks extremely hardware-specific.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

@github-actions github-actions bot added the component:awx_collection issues related to the collection for controlling AWX label Oct 2, 2023
@AlanCoding AlanCoding requested a review from djyasin October 3, 2023 15:18
@AlanCoding AlanCoding merged commit e72e9f9 into ansible:devel Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:awx_collection issues related to the collection for controlling AWX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants