From 226bf7b227076118eb42f195b275caf5ca0dabf9 Mon Sep 17 00:00:00 2001 From: Pilou Date: Thu, 12 Dec 2019 19:45:54 +0000 Subject: [PATCH] apt target: use 'until' when the cache is updated (#65456) This integration target can be unstable due to network/mirror issues: TASK [apt : uninstall hello with apt] *** fatal: [testhost]: FAILED! => { "changed": false, "cmd": "apt-get update", "msg": "E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/source/Sources.gz File has unexpected size (354740 != 354745). Mirror sync in progress? [...]", "rc": 100, [...] --- test/integration/targets/apt/tasks/apt-multiarch.yml | 2 ++ test/integration/targets/apt/tasks/apt.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/test/integration/targets/apt/tasks/apt-multiarch.yml b/test/integration/targets/apt/tasks/apt-multiarch.yml index e0ade2bbc50..6241664de25 100644 --- a/test/integration/targets/apt/tasks/apt-multiarch.yml +++ b/test/integration/targets/apt/tasks/apt-multiarch.yml @@ -4,6 +4,8 @@ - name: install hello:{{ apt_foreign_arch }} with apt apt: pkg=hello:{{ apt_foreign_arch }} state=present update_cache=yes + register: apt_result + until: apt_result is success - name: uninstall hello:{{ apt_foreign_arch }} with apt apt: pkg=hello:{{ apt_foreign_arch }} state=absent purge=yes diff --git a/test/integration/targets/apt/tasks/apt.yml b/test/integration/targets/apt/tasks/apt.yml index f9fcdfe3d0b..871cb0d7ba9 100644 --- a/test/integration/targets/apt/tasks/apt.yml +++ b/test/integration/targets/apt/tasks/apt.yml @@ -88,6 +88,7 @@ - name: uninstall hello with apt apt: pkg=hello state=absent purge=yes register: apt_result + until: apt_result is success - name: check hello with dpkg shell: dpkg-query -l hello