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

tests: speedup prepare statement part 1 #3564

Merged

Conversation

sergiocazzolato
Copy link
Collaborator

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.

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-io
Copy link

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.

Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

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

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 ' ')"
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice!

@stolowski stolowski merged commit 2a0e619 into snapcore:master Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants