tests: speedup prepare statement part 1 #3564

Merged
merged 1 commit into from Jul 7, 2017

Conversation

Projects
None yet
4 participants
Contributor

sergiocazzolato commented Jul 6, 2017

This change is proposing a simple change to save about 200 ms for every
test by changing how service units are get. Also is reducing some time
in the econnreset test.

tests: speedup prepare statement part 1
This change is proposing a simple change to save about 200 ms for every
test by changing how service units are get. Also is reducing some time
in the econnreset test.

Codecov Report

Merging #3564 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3564      +/-   ##
==========================================
- Coverage   76.76%   76.76%   -0.01%     
==========================================
  Files         379      379              
  Lines       26277    26277              
==========================================
- Hits        20172    20171       -1     
- Misses       4313     4314       +1     
  Partials     1792     1792
Impacted Files Coverage Δ
interfaces/sorting.go 90% <0%> (-6.67%) ⬇️
cmd/snap/cmd_aliases.go 96% <0%> (+2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25d78d0...1d29e6b. Read the comment docs.

Looks good, every tiny bit saved in prepare.sh helps, +1!

- mounts="$(systemctl list-unit-files --full | grep "^$escaped_snap_mount_dir[-.].*\.mount" | cut -f1 -d ' ')"
- services="$(systemctl list-unit-files --full | grep "^$escaped_snap_mount_dir[-.].*\.service" | cut -f1 -d ' ')"
- for unit in $services $mounts; do
+ units="$(systemctl list-unit-files --full | grep -e "^$escaped_snap_mount_dir[-.].*\.mount" -e "^$escaped_snap_mount_dir[-.].*\.service" | cut -f1 -d ' ')"
@stolowski

stolowski Jul 7, 2017

Contributor

Very nice!

@stolowski stolowski merged commit 2a0e619 into snapcore:master Jul 7, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment