I'm still hitting the race condition in the test consistently on local provider. I believe the issue is that the sentry.wait() after setting the config doesn't actually block because the unit is not executing the hook yet when it gets there, so the file check happens before the hook is done.
I'm still hitting the race condition in the test consistently on local provider. I believe the issue is that the sentry.wait() after setting the config doesn't actually block because the unit is not executing the hook yet when it gets there, so the file check happens before the hook is done.
I submitted a MP against this branch (https:/ /code.launchpad .net/~johnsca/ charms/ trusty/ nagios/ pagerduty- test-race/ +merge/ 269401) with the suggested work-around. That will retry three times at 5 second intervals. Depending on the cloud, you may want to increase that, but on local provider that duration (15s) was sufficient and the test passed.