Test: index dump on test failure

This changes adds the ability for a test to create an index dump if a search request fails the test. This can be helpful to be able to analyse the index state after the test has failed
This method creates the repository rather than the actual index dump. So the check is just whether the repository already exists, as it will error if we attempt to create an already existing repository.  The dump snapshot can be created in the other method regardless of this