Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17321: Fix TestSolrCoreSnapshots.testBackupRestore #2539

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

iamsanjay
Copy link
Contributor

TestSolrCoreSnapshots.testBackupRestore test started failing on Windows after merging #2501.

Thank you @HoustonPutman for reporting this. This one specifically failed due to the backslash in the windows location path that passed to the URI ctor.

The solution for this issue is to encode all the passed params before passing it to the URI ctor.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@iamsanjay
Copy link
Contributor Author

Is there anyway to test this on Windows?

@HoustonPutman
Copy link
Contributor

This will probably work, but using a string builder to build a URL just seems wrong (and this isn't the only place in the file that does it). It will probably be harder, but it would be great if we could build URL/URIs in a correct way in BackupRestoreUtil. I guess when the v2 APIs cover this, then a lot of this will not be useful anymore.

@iamsanjay
Copy link
Contributor Author

Replaced the StringBuilder with URIBuilder and also there is no need to explicitly encode the params as URIBuilder takes care of it.

Is there any way to test TestHdfsBackupRestoreCore?

Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

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

LGTM. Is the URIBuilder something that we should be using in more places?

@HoustonPutman
Copy link
Contributor

LGTM. Is the URIBuilder something that we should be using in more places?

I certainly think so

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

This looks great!

@HoustonPutman HoustonPutman merged commit 233eddb into apache:main Jul 10, 2024
3 checks passed
@epugh
Copy link
Contributor

epugh commented Jul 10, 2024

LGTM. Is the URIBuilder something that we should be using in more places?

I certainly think so

How do we get these tasks actually tracked and moved forward? Worth opening a jira? We have a patten of "we should do" but then it's just in our heads!

@dsmiley
Copy link
Contributor

dsmiley commented Jul 21, 2024

URIBuilder is in the Apache HttpClient dependency, using it goes in the opposite direction we're trying to go in! Granted in tests, this isn't a priority, so this PR is acceptable. But be mindful please.

We have a patten of "we should do"

That could be quite a list; I'm not sure what tracking it accomplishes. If something is important enough, create a JIRA. Ideally when a "we should do" is identified, it can be done everywhere instead of just one spot.

iamsanjay added a commit to iamsanjay/solr that referenced this pull request Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants