-
Notifications
You must be signed in to change notification settings - Fork 320
Resets the connection (and sets partial download to false) if the range is not satisfiable by the server #795
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
Resets the connection (and sets partial download to false) if the range is not satisfiable by the server #795
Conversation
…ge is not satisfiable by the server
Looks good in general, but could you add a test to it? |
@wisechengyi thanks, will love to, but I’m not sure how/where to test this behaviour. I guess in tests/jvm/src/it/[...] would be the place to do it? |
About testing that, there's already a small http server running during the integration tests (used here for example). It could be used, along with a cache from a temporary directory, to ensure that the cache download behaves well in that case. The test can be added under |
The test server can be manually launched via
|
Thanks for the pointers @alexarchambault I'll get this tested ASAP |
@alexarchambault I think I need another pointer, can't figure out a crucial step here. I'm using coursier/tests/jvm/src/it/scala/coursier/test/HttpAuthenticationTests.scala Lines 56 to 59 in 2747d1e
check but a custom method because I need to mess with the cache). But I can't figure out how to get artifacts to appear in the cache temporary directory (I'm basing off check here: https://github.com/coursier/coursier/blob/master/tests/jvm/src/test/scala/coursier/test/CacheFetchTests.scala ) After the resolution step only pom s, sha s and similar appear in the cache folder, even if the mock server contains jar artifacts for the module. My impression was that once the Resolution finishes the cache should be populated, but that might not be the case?
|
After the resolution, only the POMs (and their checksums) are fetched. JARs are fetched in a second time (it corresponds to the To test your changes, I think you can just create a |
I'd be ok with merging as is without proper tests, as the cache module itself doesn't have a test suite. We can just add a comment saying loudly what the added condtion handles, and that it can be tested once cache has some proper tests… On my side, I was planning to add some while porting the cache module to nio. Tests for this can be added after that IMO. |
Hi @alexarchambault I'm a bit busy atm, but I'd feel bad merging without the test in place now I have a vague idea of how to do it. Alternatively, it could be merged and I create a new issue ( |
How about doing so from the cli test suite side? like https://github.com/coursier/coursier/pull/797/files#diff-091ffa792cee5668b5b2ab31820ac6eeR756, but in this case we are not corrupting the jar, but just rename it to xxx.jar.part. and it does not involve setting up a http server. |
Hi @wisechengyi @alexarchambault thanks a lot, indeed. I worked off your PR (to have the full
|
@alexarchambault if PR #799 is merged then I can add my test to the rest of the CLI suite |
@wisechengyi @alexarchambault test added, thanks for all the help to get it :) |
Thanks @rberenguel! |
Addresses Issue #794