Skip to content

Conversation

@zuiderkwast
Copy link
Contributor

@zuiderkwast zuiderkwast commented Feb 7, 2025

Attempt to fix non-jemalloc builds by disabling this test case on non-jemalloc builds:

*** [err]: Memory usage of embedded string value in tests/unit/type/string.tcl
Expected '40' to be less than or equal to '32' (context: type eval line 5 cmd {assert_lessthan_equal [r memory usage quux] 32} proc ::test)

We can't assume anything about allocation size classes for arbitrary allocators.

Glibc malloc seems to give usable sizes of 24, 40, 56, 72, 88, 104, ..., not similar to jemalloc size classes.

Additional change: encode unused robj allocation space in the EMBSTR sds header. This makes the test case able to correctly calculate the memory overhead of the different structures in 32-bit builds, where there is some unused space in the allocation (because the robj header is smaller).

@zuiderkwast zuiderkwast added test-failure An issue indicating a test failure run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP) labels Feb 7, 2025
@codecov
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.02%. Comparing base (fc55142) to head (50d3a40).
Report is 3 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #1685   +/-   ##
=========================================
  Coverage     71.02%   71.02%           
=========================================
  Files           121      121           
  Lines         65254    65255    +1     
=========================================
+ Hits          46344    46347    +3     
+ Misses        18910    18908    -2     
Files with missing lines Coverage Δ
src/object.c 82.19% <100.00%> (+0.01%) ⬆️

... and 11 files with indirect coverage changes

@zuiderkwast zuiderkwast marked this pull request as ready for review February 7, 2025 15:35
@zuiderkwast zuiderkwast merged commit 7fa784a into valkey-io:unstable Feb 8, 2025
55 of 59 checks passed
@zuiderkwast zuiderkwast deleted the disable-memusage-test-non-jemalloc branch February 8, 2025 02:50
xbasel pushed a commit to xbasel/valkey that referenced this pull request Mar 27, 2025
Attempt to fix non-jemalloc builds by disabling this test case on
non-jemalloc builds:

```
*** [err]: Memory usage of embedded string value in tests/unit/type/string.tcl
Expected '40' to be less than or equal to '32' (context: type eval line 5 cmd {assert_lessthan_equal [r memory usage quux] 32} proc ::test)
```

We can't assume anything about allocation size classes for arbitrary
allocators.

Glibc malloc seems to give usable sizes of 24, 40, 56, 72, 88, 104, ...,
not similar to jemalloc size classes.

Additional change: encode unused robj allocation space in the EMBSTR sds
header. This makes the test case able to correctly calculate the memory
overhead of the different structures in 32-bit builds, where there is
some unused space in the allocation (because the `robj` header is
smaller).

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
xbasel pushed a commit to xbasel/valkey that referenced this pull request Mar 27, 2025
Attempt to fix non-jemalloc builds by disabling this test case on
non-jemalloc builds:

```
*** [err]: Memory usage of embedded string value in tests/unit/type/string.tcl
Expected '40' to be less than or equal to '32' (context: type eval line 5 cmd {assert_lessthan_equal [r memory usage quux] 32} proc ::test)
```

We can't assume anything about allocation size classes for arbitrary
allocators.

Glibc malloc seems to give usable sizes of 24, 40, 56, 72, 88, 104, ...,
not similar to jemalloc size classes.

Additional change: encode unused robj allocation space in the EMBSTR sds
header. This makes the test case able to correctly calculate the memory
overhead of the different structures in 32-bit builds, where there is
some unused space in the allocation (because the `robj` header is
smaller).

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
murphyjacob4 pushed a commit to enjoy-binbin/valkey that referenced this pull request Apr 13, 2025
Attempt to fix non-jemalloc builds by disabling this test case on
non-jemalloc builds:

```
*** [err]: Memory usage of embedded string value in tests/unit/type/string.tcl
Expected '40' to be less than or equal to '32' (context: type eval line 5 cmd {assert_lessthan_equal [r memory usage quux] 32} proc ::test)
```

We can't assume anything about allocation size classes for arbitrary
allocators.

Glibc malloc seems to give usable sizes of 24, 40, 56, 72, 88, 104, ...,
not similar to jemalloc size classes.

Additional change: encode unused robj allocation space in the EMBSTR sds
header. This makes the test case able to correctly calculate the memory
overhead of the different structures in 32-bit builds, where there is
some unused space in the allocation (because the `robj` header is
smaller).

---------

Signed-off-by: Viktor Söderqvist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP) test-failure An issue indicating a test failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants