Skip to content

Conversation

@catap
Copy link
Contributor

@catap catap commented Jan 25, 2026

Description

At least it allows me to more or less use MusicBrainz, and makes issues from #6312 almost not noticible

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

@catap catap requested a review from a team as a code owner January 25, 2026 11:42
@github-actions
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

At least it allows me to more or less use MusicBrainz
Copy link
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment

Comment on lines +17 to +33
def make_response():
if isinstance(last_response, HTTPResponse):
body = last_response.data
return HTTPResponse(
body=io.BytesIO(body),
status=last_response.status,
preload_content=False,
headers=last_response.headers,
)
return last_response

def responses():
yield NewConnectionError(None, "Connection failed")
yield URLError("bad")
while True:
yield make_response()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to stare at this for a couple of minutes until I managed to work out how does this work 😅 I think this needs to be simplified...

However, there is a more significant issue - test durations:

$ poe test --durations=10 test/plugins/utils/test_request_handler.py
...
=============================================================================== slowest 10 durations ===============================================================================
31.04s call     test/plugins/utils/test_request_handler.py::TestRequestHandlerRetry::test_retry_exhaustion[conn_error]
31.03s call     test/plugins/utils/test_request_handler.py::TestRequestHandlerRetry::test_retry_exhaustion[server_error]
1.01s call     test/plugins/utils/test_request_handler.py::TestRequestHandlerRetry::test_retry_on_connection_error[success]
0.13s setup    test/plugins/utils/test_request_handler.py::TestRequestHandlerRetry::test_retry_on_connection_error[success]

Tests that take 30s are now viable here, unfortunately. I think we want to re-think how do we test this configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a price tag. Frankly, I not sure that we should test it. And yes, figure out how to test it was... quite a challenge!

But I have no idea how to test timeout based things without time penalty.

@catap
Copy link
Contributor Author

catap commented Jan 28, 2026

@snejus what do you think about this tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants