-
Notifications
You must be signed in to change notification settings - Fork 562
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
tests: download core and ubuntu-core at most once #3641
Conversation
This patch relies on snapd's ability to resume partial downloads. In the one-off preparation phase we download a set of snaps, chop off the last byte and move them to /var/lib/snapd/snaps adding the .partial suffix to enable the download beavior. Each test that needs to pull in one of those two fill then take advantage of the existing file and will do minimal network traffic required to achieve this. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Codecov Report
@@ Coverage Diff @@
## master #3641 +/- ##
==========================================
- Coverage 75.2% 75.16% -0.04%
==========================================
Files 387 388 +1
Lines 33452 33628 +176
==========================================
+ Hits 25159 25278 +119
- Misses 6481 6534 +53
- Partials 1812 1816 +4
Continue to review full report at Codecov.
|
tests/lib/prepare.sh
Outdated
# There is a bug in snapd where partial file must be a proper | ||
# prefix of the full file or we make a wrong request to the | ||
# store. | ||
truncate --size=$(expr $(stat $snap_file.partial -c %s) - 1) $snap_file.partial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
truncate --size=-1
would DWYW 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't know that works. Nice!
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Merging, I just saw another test failing on "whooping" 100KB/s download speed that ended up with timeout. |
# There is a bug in snapd where partial file must be a proper | ||
# prefix of the full file or we make a wrong request to the | ||
# store. | ||
truncate --size=-1 $snap_file.partial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zyga did you land a patch to drop this truncate
?
This patch relies on snapd's ability to resume partial downloads. In
the one-off preparation phase we download a set of snaps, chop off the
last byte and move them to /var/lib/snapd/snaps adding the .partial
suffix to enable the download beavior. Each test that needs to pull in
one of those two fill then take advantage of the existing file and will
do minimal network traffic required to achieve this.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com