Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

pkg-layering: continue on failure #398

Merged
merged 2 commits into from
May 22, 2018

Conversation

mike-nguyen
Copy link
Collaborator

This commit is a continuation of the continue on failure effort using
Ansible's block/rescue/always for package layering.

All tests were separarated into individual task files and called as an
include inside a block/rescue clause to catch failures and continue
onto the next test.

verify_package_deployed.yml and verify_package_not_deployed.yml were
removed in favor of an existing role that provided the same
functionality.

Partially address #375

This commit is a continuation of the continue on failure effort using
Ansible's block/rescue/always for package layering.

All tests were separarated into individual task files and called as an
include inside a block/rescue clause to catch failures and continue
onto the next test.

verify_package_deployed.yml and verify_package_not_deployed.yml were
removed in favor of an existing role that provided the same
functionality.
PR projectatomic#368 added a check for a boot_id to confirm reboots in the reboot
role.  This caused a race condition in the rpm_ostree_install and
rpm_ostree_uninstall roles when using the reboot flag.

The reboot role has an option to not perform a reboot and just check
that the system comes down and back up.  This was leverage by
rpm_ostree_install and rpm_ostree_uninstall roles to fire the the
respective commands with the -r flag.  The -r flag causes a reboot to
occur when the command executes but requires to be run asychronously
(the command won't return when the system goes down and will cause
Ansible to fail).  When rpm_ostree_install/rpm_ostree_uninstall was
called with the -r flag it calls the reboot role.  If the reboot role
can execute before the reboot occurs, it will successfully execute.
If the system goes down before the reboot role can grab the boot_id,
it will fail.

This PR modifies the reboot_flag test to not use the reboot role.  It
copies most of the logic from the reboot role into the test itself.
Since this was a corner case for the -r flag, I felt like it was an
appropriate exception to not re-use the role.
@miabbott
Copy link
Collaborator

Nice work on fixing that race condition!

@miabbott miabbott merged commit 32e9af1 into projectatomic:master May 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants