Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition in reboot flag test
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.
- Loading branch information