[go: nahoru, domu]

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

test(general): set cache size limits for the repository under test used in robustness tests #3945

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

Conversation

chaitalisg
Copy link
Contributor
@chaitalisg chaitalisg commented Jun 27, 2024

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.

@chaitalisg chaitalisg changed the title test(general): set cache size limits for the repository under test test(general): set cache size limits for the repository under test used in robustness tests Jun 27, 2024
Copy link
codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.16%. Comparing base (cb455c6) to head (748ab8e).
Report is 185 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@chaitalisg chaitalisg marked this pull request as ready for review June 27, 2024 22:20
@@ -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 {
Copy link
Collaborator

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.

Copy link
Contributor Author

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 {
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants