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