Retry integration tests on transient service errors#574
Conversation
jan-sauer-reef
left a comment
There was a problem hiding this comment.
Nice! Unless async integration tests are categorically out of the question, though, I would add a provision in the pytest_pyfunc_call function to await async tests, otherwise they'll pass almost-silently (albeit with a RuntimeWarning).
|
|
||
| for attempt in range(INTEGRATION_TEST_RETRY_COUNT + 1): | ||
| try: | ||
| testfunction(**testargs) |
There was a problem hiding this comment.
There are no async tests but if there ever were in the future, they would never be awaited and unless the test runner sees the runtime warning, they'd never know -> they'd appear to always pass. It might be worth checking that testfunction isn't async.
|
|
||
| from b2sdk._internal.exception import ServiceError, TooManyRequests | ||
|
|
||
| RETRYABLE_SERVICE_ERROR_STATUSES = {500, 503} |
There was a problem hiding this comment.
Tests are retried on 500 errors but the bucket operations in _retry_bucket_test_operation() only on 503.
a) Is nested retry logic necessary for a test?
b) If so, shouldn't the BucketManager also retry on 500 errors then?
This PR verifies integration retry behavior against live B2 CI credentials.\n\nIt adds integration-test retries for transient B2 service errors and an upload test that uses the documented X-Bz-Test-Mode: fail_some_uploads hook.