From 0ee49dae7623fa2ebc1fdfb82612b92dc0245e82 Mon Sep 17 00:00:00 2001 From: Nikhil Jain Date: Fri, 12 Mar 2021 14:57:52 +0530 Subject: [PATCH] fix tower collection integration test race condition --- .../targets/tower_job_launch/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/awx_collection/tests/integration/targets/tower_job_launch/tasks/main.yml b/awx_collection/tests/integration/targets/tower_job_launch/tasks/main.yml index 14d7f7c236..4599682fbf 100644 --- a/awx_collection/tests/integration/targets/tower_job_launch/tasks/main.yml +++ b/awx_collection/tests/integration/targets/tower_job_launch/tasks/main.yml @@ -164,6 +164,18 @@ that: - "result is changed" +- name: Wait for a job template to complete + tower_job_wait: + job_id: "{{ result.id }}" + max_interval: 10 + timeout: 120 + register: result + +- assert: + that: + - "result is not changed" + - "result.status == 'successful'" + - name: Get the job tower_job_list: query: {"id": "{{result.id}}"}