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
When would we get an exception here, vs a response above that we loop through to check for existence?  Can we just use running test info + randomness to avoid  this checking if the dump already exists?