This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fleetctl: periodically check for systemd states using waitForState
Although checkSystemdActiveState() doesn't have to depend on cAPI.UnitStates(), it's still impossible to remove additional sleep in case of error from assertSystemdActiveState(). That's actually a known issue. Sometimes it simply takes much time until fleetctl became able to get valid unit states. Adding additional sleeps or tuning the sleep time wouldn't be a good approach, as an optimal sleep interval could vary a lot case by case. To gracefully handle this case, let's do similar checking as done in functional tests. * Introduce a new helper waitForState(), just like util.WaitForState() from functional tests. * Squash assertFetchSystemdActiveState() into assertSystemdActiveState() to make it retry the assertion periodically up to defaultSleepTime. * Increase defaultSleepTime from 500 to 2000 msec. * Remove the additional sleep call as well as cAPI.UnitState() call.
- Loading branch information