Skip to content

Fix stale error-message substring assertions in string/expression tests - #264

Closed
diparthaspike wants to merge 1 commit into
v3from
fix-stale-error-message-assertions
Closed

diparthaspike wants to merge 1 commit into
v3from
fix-stale-error-message-assertions

Conversation

@diparthaspike

Copy link
Copy Markdown

Two tests in tests/src/exp_string.rs and tests/src/string.rs checked for old error-message substrings ("FilteredOut", "BinTypeError") that stopped matching once CLIENT-5492 (#262) reworked Error's Display to human prose ("Transaction filtered out", "Bin type error"). Never caught in CI because both tests gate on server >= 8.1.3, and no CI server had ever actually been new enough to run them until Docker Hub's aerospike/aerospike-server:latest moved to 8.2.0.0.

Fixed by asserting on err.server_result_code() directly instead of matching Display text, so this can't go stale again the next time the message wording changes.

Verified against a live 8.2.0 server: both pass.

CLIENT-5492 (PR #262) changed Error's Display from enum-style names
("FilteredOut", "BinTypeError") to human prose ("Transaction filtered
out", "Bin type error"), but these two tests still checked for the old
substrings. Never caught because both tests gate on server >= 8.1.3
(server_supports_string_operations) and no CI server had ever been new
enough to actually execute the assertion until Docker Hub's
aerospike/aerospike-server:latest moved to 8.2.0.0.

Switched both to assert_eq! against err.server_result_code() directly
instead of matching Display text, so this can't go stale again.
Verified against a live 8.2.0 server: both pass.
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.

1 participant