Search code examples
integration-testingchef-solotest-kitchenserverspec

How to set delay between converge and verify on kitchen test?


I'm running Serverspec integration smoke tests with Test Kitchen on a system built with Vagrant+Chef Solo. When i run kitchen test then the tests are started right after successful converge, and some of my tests fail because it takes time for the system to fully start up for the first time.

So i'm wondering what would be a good way to insert delay between converge and verify, otherwise preserving the default behaviour of kitchen test? Currently i have the following ideas:

  1. write a shell script that does kitchen converge+check if converge was unsuccessful, then abort+sleep xx+kitchen verify+if successful then kitchen destroy. But this would not allow to run multiple suites on parallel (i'm testing multiple versions of the system).
  2. create a recipe that just executes sleep xx and append it to the end of chef run list. This seems to work, but looks a bit too "hacky" for me.

Does anyone know a better way?

taavi


Solution

  • For now i went on with idea 2. Also created a feature request: https://github.com/test-kitchen/test-kitchen/issues/598