Skip to content

Stop extensively test no longer used gui.dandiarchive.org, retry HEAD (redirects) upon requests.ConnectionError#1632

Merged
yarikoptic merged 7 commits intomasterfrom
enh-tests
May 22, 2025
Merged

Stop extensively test no longer used gui.dandiarchive.org, retry HEAD (redirects) upon requests.ConnectionError#1632
yarikoptic merged 7 commits intomasterfrom
enh-tests

Conversation

@yarikoptic
Copy link
Copy Markdown
Member

We long migrated to just dandiarchive.org . Excessive use of gui. resulted in too many redirects and seems like likely heroku limiting our requests thus tests some times failing to get all the way to redirected site. But since we no longer even use gui. domain, there is no need to test it. I also adjusted test to exclude /# from URL since also no longer there and would be redirected/handled.

I would consider it

Also added one more change to test redirect actually against this gui. (but once) instead of bit.ly -- hopefully would be more robust on windows.

We long migrated to just dandiarchive.org . Excessive use of gui. resulted
in too many redirects and seems like likely heroku limiting our requests
thus tests some times failing to get all the way to redirected site.
But since we no longer even use gui.  domain, there is no need to test it.
I also adjusted test to exclude /# from URL since also no longer there
and would be redirected/handled.
@yarikoptic yarikoptic added the tests Add or improve existing tests label May 22, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented May 22, 2025

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.84%. Comparing base (3e8b645) to head (cd935b7).
⚠️ Report is 72 commits behind head on master.

Files with missing lines Patch % Lines
dandi/dandiarchive.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1632      +/-   ##
==========================================
+ Coverage   88.68%   88.84%   +0.16%     
==========================================
  Files          82       82              
  Lines       11400    11434      +34     
==========================================
+ Hits        10110    10159      +49     
+ Misses       1290     1275      -15     
Flag Coverage Δ
unittests 88.84% <95.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yarikoptic
Copy link
Copy Markdown
Member Author

One Ubuntu still failed that test_follow_redirect

@yarikoptic
Copy link
Copy Markdown
Member Author

changes to test_follow_redirect were not really effective... will look into raising number of retries

We keep getting ConnectionResetErrors on windows while following redirects.
That was not handled at all, so we did not retry. Added support for retries there

Closes #1604
@yarikoptic yarikoptic changed the title Stop extensively test no longer used gui.dandiarchive.org Stop extensively test no longer used gui.dandiarchive.org, retry HEAD (redirects) upon requests.ConnectionError May 22, 2025
@yarikoptic yarikoptic added the patch Increment the patch version when merged label May 22, 2025
Extends existing test_follow_redirect with two new test cases:
- test_follow_redirect_retry_on_connection_error: verifies successful retry after ConnectionError
- test_follow_redirect_exhausted_retries_on_connection_error: verifies proper exception handling after retry exhaustion

These tests complement the retry functionality added in b5dbeb9 to handle
frequent ConnectionErrors on Windows during redirect following.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yarikoptic
Copy link
Copy Markdown
Member Author

As green as it gets now. Reviewers invited (attn @candleindark and @asmacdo )

Copy link
Copy Markdown
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

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

Duplicate params should be removed, other suggestions are just nitpicks and can be ignored.

@yarikoptic yarikoptic requested a review from asmacdo May 22, 2025 17:22
Copy link
Copy Markdown
Member

@asmacdo asmacdo left a comment

Choose a reason for hiding this comment

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

LGTM once CI is green!

otherwise we get typing check failing us. Was not present when we had
"while True" loop before
@yarikoptic
Copy link
Copy Markdown
Member Author

ha -- that typing check complaint now might have likely be a sideeffect of replacing that while True loop! Let's hope that for would work as nicely and not run into ;-)

@yarikoptic
Copy link
Copy Markdown
Member Author

very green, very good. Let's proceed

@yarikoptic yarikoptic merged commit 6d30523 into master May 22, 2025
30 checks passed
@yarikoptic yarikoptic deleted the enh-tests branch May 22, 2025 19:32
@github-actions
Copy link
Copy Markdown

🚀 PR was released in 0.69.1 🚀

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

Labels

patch Increment the patch version when merged released tests Add or improve existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make connections retry in more spots

2 participants