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

Fix sds unittest tests to check for zmalloc_usable_size #1314

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Nov 16, 2024

s_malloc_size == zmalloc_size, currently sdsAllocSize does not
calculate PREFIX_SIZE when no malloc_size available, this casue
test_typesAndAllocSize fail in the new unittest, what we want to
check is actually zmalloc_usable_size.

Currently sdsAllocSize does not calculate PREFIX_SIZE when no
malloc_size available, this casue test_typesAndAllocSize fail
in the new unittest.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin
Copy link
Member Author

enjoy-binbin commented Nov 16, 2024

I guess we don't want to modify sdsAllocSize to include it? so i just modify the test.
Also see #502 and #694 for more details.

The failure test CI: https://github.com/valkey-io/valkey/actions/runs/11865335400/job/33070348096#step:7:254

Signed-off-by: Binbin <[email protected]>
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.67%. Comparing base (aa2dd3e) to head (4770360).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1314      +/-   ##
============================================
- Coverage     70.73%   70.67%   -0.07%     
============================================
  Files           115      115              
  Lines         63158    63158              
============================================
- Hits          44674    44636      -38     
- Misses        18484    18522      +38     

see 11 files with indirect coverage changes

Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

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

I'm okay with this to get the tests passing regardless, I feel like there is probably a better way to expose the API to the testing though.

src/unit/test_sds.c Outdated Show resolved Hide resolved
src/unit/test_sds.c Outdated Show resolved Hide resolved
src/zmalloc.h Outdated Show resolved Hide resolved
@enjoy-binbin enjoy-binbin changed the title Add zmalloc PREFIX_SIZE to fix sds alloc size test Fix sds unittest tests to check for zmalloc_usable_size Nov 18, 2024
@enjoy-binbin enjoy-binbin merged commit d07674f into valkey-io:unstable Nov 18, 2024
48 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_sds_size branch November 18, 2024 06:55
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.

3 participants