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: measure state lock #14874

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sergiocazzolato
Copy link
Collaborator

@sergiocazzolato sergiocazzolato commented Dec 18, 2024

This change allows to collect the time the snapd state file is locked. To collect the results it is required to include the test snapd-state-lock and make sure just 1 worker is used.

SPREAD_SNAPD_STATE_LOCK_THRESHOLD_MS=15 SPREAD_USE_SNAPD_SNAP_URL= SPREAD_USE_PREBUILT_SNAPD_SNAP=false ./run-spread -artifacts .artifacts google:ubuntu-22.04-64:tests/main/snapd-state-lock google:ubuntu-22.04-64:tests/smoke/

this is an example of the smoke suite with threshold=15ms: https://paste.ubuntu.com/p/vkcMdcGTnM/
this is an example of the smoke suite with threshold=100ms: https://paste.ubuntu.com/p/XTn8jZ62pJ/

@sergiocazzolato sergiocazzolato marked this pull request as draft December 18, 2024 02:34
@sergiocazzolato sergiocazzolato force-pushed the tests-measure-state-lock branch from 0d1c64f to f46e537 Compare December 18, 2024 17:40
@sergiocazzolato sergiocazzolato added the Needs Samuele review Needs a review from Samuele before it can land label Dec 19, 2024
@sergiocazzolato sergiocazzolato marked this pull request as ready for review December 19, 2024 16:51
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

question

@@ -139,6 +142,7 @@ func (s *State) Modified() bool {

// Lock acquires the state lock.
func (s *State) Lock() {
s.lockStart = osutil.GetLockStart()
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be done with the lock taken? otherwise just the tentative themselves to lock will race/dirty lockStart

@pedronis pedronis requested a review from bboozzoo December 20, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Samuele review Needs a review from Samuele before it can land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants