wait for the cluster to be ready during tests

This change avoids a race condition when creating and dropping the
indices that can cause tests to fail with a message about no shards
being available.