Skip to content

Fix memory usage check in test for embedded objects#1675

Merged
zuiderkwast merged 1 commit into
valkey-io:unstablefrom
zuiderkwast:fix-memory-usage-embedded-object-test
Feb 6, 2025
Merged

Fix memory usage check in test for embedded objects#1675
zuiderkwast merged 1 commit into
valkey-io:unstablefrom
zuiderkwast:fix-memory-usage-embedded-object-test

Conversation

@zuiderkwast

@zuiderkwast zuiderkwast commented Feb 5, 2025

Copy link
Copy Markdown
Contributor

Fixes the following test case which fails in builds with allocators that don't have usable size:

*** [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)

With allocators like libc malloc that doesn't have usable size, zmalloc stores an extra size field in the allocation. This makes the memory usage 8 bytes larger than we expected in this test case. We can just skip this check. It's not the main thing tested in this test case.

The failure was introduced in #1613.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
@zuiderkwast zuiderkwast added 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 labels Feb 5, 2025
@codecov

codecov Bot commented Feb 5, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.05%. Comparing base (8d8ce19) to head (b11d546).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #1675   +/-   ##
=========================================
  Coverage     71.05%   71.05%           
=========================================
  Files           121      121           
  Lines         65243    65243           
=========================================
+ Hits          46357    46360    +3     
+ Misses        18886    18883    -3     

see 14 files with indirect coverage changes

@zuiderkwast zuiderkwast requested a review from madolson February 5, 2025 23:53
@zuiderkwast zuiderkwast merged commit 110dd55 into valkey-io:unstable Feb 6, 2025
@zuiderkwast zuiderkwast deleted the fix-memory-usage-embedded-object-test branch February 6, 2025 00:19
xbasel pushed a commit to xbasel/valkey that referenced this pull request Mar 27, 2025
Fixes the following test case which fails in builds with allocators that
don't have usable size:

```
*** [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)
```

With allocators like libc malloc that doesn't have usable size, zmalloc
stores an extra size field in the allocation. This makes the memory
usage 8 bytes larger than we expected in this test case. We can just
skip this check. It's not the main thing tested in this test case.

The failure was introduced in valkey-io#1613.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
xbasel pushed a commit to xbasel/valkey that referenced this pull request Mar 27, 2025
Fixes the following test case which fails in builds with allocators that
don't have usable size:

```
*** [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)
```

With allocators like libc malloc that doesn't have usable size, zmalloc
stores an extra size field in the allocation. This makes the memory
usage 8 bytes larger than we expected in this test case. We can just
skip this check. It's not the main thing tested in this test case.

The failure was introduced in valkey-io#1613.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
murphyjacob4 pushed a commit to enjoy-binbin/valkey that referenced this pull request Apr 13, 2025
Fixes the following test case which fails in builds with allocators that
don't have usable size:

```
*** [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)
```

With allocators like libc malloc that doesn't have usable size, zmalloc
stores an extra size field in the allocation. This makes the memory
usage 8 bytes larger than we expected in this test case. We can just
skip this check. It's not the main thing tested in this test case.

The failure was introduced in valkey-io#1613.

Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
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