Add tests for retry on 500, no retry on 400