-
Notifications
You must be signed in to change notification settings - Fork 724
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: try to make s2n_mem_usage_test more useful #5139
Conversation
ebd59f3
to
3fefd6e
Compare
@@ -50,32 +50,11 @@ | |||
* usage. The greater the value, the more accurate the end result. */ | |||
#define MAX_CONNECTIONS 1000 | |||
|
|||
/* This is roughly the current memory usage per connection, in KB */ |
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.
good riddance to this bit.
tests/unit/s2n_mem_usage_test.c
Outdated
/* A change of more than 5% is significant */ | ||
#define ALLOWED_VARIANCE .05 |
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.
Thinking about it, should this be even stricter? 3%? Or should any change to the final "KB" number require an update to the test-- so 0%? That would still let changes <1KB through.
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.
1KB seems like kind of a lot, right? I feel like 0% would be enough variance. Not sure though.
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.
Let's do 0 and we can always add some wiggle room later if we need it.
tests/unit/s2n_mem_usage_test.c
Outdated
/* A change of more than 5% is significant */ | ||
#define ALLOWED_VARIANCE .05 |
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.
1KB seems like kind of a lot, right? I feel like 0% would be enough variance. Not sure though.
Co-authored-by: Sam Clark <[email protected]>
Maybe I shouldn't keep ripping out old code
Release Summary:
Resolved issues:
resolves #5121 (comment)
Description of changes:
I always dread touching s2n_mem_usage because changing the expected values always breaks the test SOMEWHERE. I've also had the test fail locally even though I updated MEM_PER_CONNECTION to the value the test told me to use, just because of the complicated math. So this PR:
Testing:
Example failure output from running it locally:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.