Assert return values in test_update_zero_should_commit / conflict
CI / build-image (arm64, ubuntu-latest-arm64) (pull_request) Failing after 21s
CI / build-image (amd64, ubuntu-latest-amd64) (pull_request) Failing after 50s
CI / pre-commit (pull_request) Has been skipped
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (pull_request) Has been skipped
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Has been skipped
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Has been skipped
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Has been skipped
CI / release (amd64, ubuntu-latest-amd64) (pull_request) Has been skipped
CI / release (arm64, ubuntu-latest-arm64) (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped

Add the missing [Result.COMMIT] / [Result.CONFLICT] assertions so
that the two regression tests actually verify the expected conflict-set
outcome, not just that the calls do not crash.
This commit is contained in:
2026-06-21 12:39:46 -04:00
parent 48f9ee46cf
commit c3c69786fe
+2 -2
View File
@@ -68,7 +68,7 @@ def test_update_zero_should_commit():
for i in range(256 - 17, 256): for i in range(256 - 17, 256):
cs2.addWrites(int(1), write(bytes([i]))) cs2.addWrites(int(1), write(bytes([i])))
# Scan until first point write # Scan until first point write
cs2.check(read(0, b"\x00", bytes([256 - 17]))) assert cs2.check(read(0, b"\x00", bytes([256 - 17]))) == [Result.COMMIT]
def test_update_zero_should_conflict(): def test_update_zero_should_conflict():
@@ -81,7 +81,7 @@ def test_update_zero_should_conflict():
# "zero" is now 2**31 + 100 # "zero" is now 2**31 + 100
cs1.addWrites(2**32 + 101, write(b"", b"\x02"), write(b"\x01")) cs1.addWrites(2**32 + 101, write(b"", b"\x02"), write(b"\x01"))
# rangeVersion of \x01 is now 2**31 + 100 ("max" of (2**31 + 100, 2**32 + 101)) # rangeVersion of \x01 is now 2**31 + 100 ("max" of (2**31 + 100, 2**32 + 101))
cs1.check(read(2**32 + 1, b"\x00")) assert cs1.check(read(2**32 + 1, b"\x00")) == [Result.CONFLICT]
# but 2**32 + 1 ">" 2**31 + 100 , and it incorrectly commits # but 2**32 + 1 ">" 2**31 + 100 , and it incorrectly commits