-
Notifications
You must be signed in to change notification settings - Fork 343
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
test(general): set cache size limits for the repository under test used in robustness tests #3945
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3945 +/- ##
==========================================
+ Coverage 75.86% 77.16% +1.30%
==========================================
Files 470 481 +11
Lines 37301 28803 -8498
==========================================
- Hits 28299 22227 -6072
+ Misses 7071 4672 -2399
+ Partials 1931 1904 -27 ☔ View full report in Codecov by Sentry. |
…pia into robustness-cache-hard-limits
@@ -67,6 +67,15 @@ func (mcs *MultiClientSnapshotter) ConnectOrCreateRepo(repoPath string) error { | |||
return err | |||
} | |||
|
|||
// SetCacheSizeLimits sets the cache size limits for an existing repository | |||
// the repository server is connected to. | |||
func (mcs *MultiClientSnapshotter) SetCacheSizeLimits(cacheArgs string) error { |
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.
What is cacheArgs
? it seems that an arbitrary flag can be passed.
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.
Added restrictions for allowed flags
@@ -145,6 +145,13 @@ func (th *TestHarness) getSnapshotter() bool { | |||
return false | |||
} | |||
|
|||
contentCacheLimitMB := "--content-cache-size-limit-mb=500" | |||
metadataCacheLimitMB := "--metadata-cache-size-limit-mb=500" | |||
if err = s.SetCacheSizeLimits(contentCacheLimitMB + metadataCacheLimitMB); err != nil { |
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.
Does this work? it seems to me that this will always return an error.
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.
Updated the code
The robustness tests set soft limits for content cache size and metadata cache size. This PR adds the hard limits for both the caches, thus reducing the memory required to run the robustness tests for long term.