pasqal-io / pasqal-cloud

Apache License 2.0
17 stars 1 forks source link

[IMPROVEMENT] Add exponential backoff retries to HTTP client #115

Closed oliver-gordon closed 7 months ago

oliver-gordon commented 7 months ago

Description

When a HTTP request fails, we will now retry it 5 times (arbitrary value, non-configurable currently) where the time between each request grows until we stop.

I've also tried to include for missing typehints and docstrings where I was updating code.

Remaining Tasks

Related PRs in other projects (PASQAL developers only)

Additional merge criteria

Breaking changes

Checklist

Versioning (PASQAL developers only)

Documentation

Tests

Internal tests pipeline (PASQAL developers only)

After updating the version (PASQAL developers only)

oliver-gordon commented 7 months ago

I couldn't find a test for the retry mechanism, could you add one?

Any test mocking an exception is testing the retry mechanism. But sure, I'll add another one

MatthieuMoreau0 commented 7 months ago

I couldn't find a test for the retry mechanism, could you add one?

Any test mocking an exception is testing the retry mechanism. But sure, I'll add another one

Either adding a new test or amending the existing ones to check that the request was retried as expected. I could get rid of the retry logic entirely and tests would still pass which is no good.