Improve performance of index discovery tests

Fixes #876 - Powered by Sinon