retry on capture errors
Add tests