Wait for index creation in aggregation tests

Review 1361 by @mlucy
Merge branch 'next' into sam_2137