Skip to content

Fix unit tests for 32-bit builds#2124

Merged
zuiderkwast merged 3 commits intovalkey-io:unstablefrom
zuiderkwast:fix-object-unit-test-32-bit
May 23, 2025
Merged

Fix unit tests for 32-bit builds#2124
zuiderkwast merged 3 commits intovalkey-io:unstablefrom
zuiderkwast:fix-object-unit-test-32-bit

Conversation

@zuiderkwast
Copy link
Contributor

@zuiderkwast zuiderkwast commented May 22, 2025

Fix these two unit test failures in 32-bit builds:

[test_random_entry_sparse_table - unit/test_hashtable.c:918] Failed assertion: picked >= values && picked < values + count`
[test_embedded_string_with_key - unit/test_object.c:72] Failed assertion: raw_obj->encoding == OBJ_ENCODING_RAW`

In 32-bit mode, the reference-counted object struct (robj) is smaller so we can fit longer values in embedded strings. Test case introduced in #2087.

For the second error, I guess it's an overflow, but the failing check isn't important for the test case so removing it. Test case introduced in #2085.

Additional change: Run unit tests in 32-bit CI build job.

Signed-off-by: Viktor Söderqvist <[email protected]>
@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 May 22, 2025
@codecov
Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.24%. Comparing base (0012ca7) to head (bf57803).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2124      +/-   ##
============================================
+ Coverage     71.21%   71.24%   +0.03%     
============================================
  Files           122      122              
  Lines         66046    66046              
============================================
+ Hits          47034    47057      +23     
+ Misses        19012    18989      -23     

see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zuiderkwast zuiderkwast changed the title Fix object unit test for 32-bit builds Fix unit tests for 32-bit builds May 22, 2025
@zuiderkwast zuiderkwast removed the run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP) label May 22, 2025
Signed-off-by: Viktor Söderqvist <[email protected]>
@zuiderkwast zuiderkwast merged commit 91bb9c4 into valkey-io:unstable May 23, 2025
47 of 49 checks passed
@zuiderkwast zuiderkwast deleted the fix-object-unit-test-32-bit branch May 23, 2025 00:55
@zuiderkwast zuiderkwast mentioned this pull request Jun 5, 2025
@hpatro hpatro added this to Valkey 8.1 Jun 5, 2025
@hpatro hpatro moved this to To be backported in Valkey 8.1 Jun 5, 2025
@hpatro hpatro moved this from To be backported to 8.1.2 in Valkey 8.1 Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-failure An issue indicating a test failure

Projects

Status: 8.1.2

Development

Successfully merging this pull request may close these issues.

2 participants