Skip to content

Commit

Permalink
kvutils: Print state updates before and after normalization. (#11096)
Browse files Browse the repository at this point in the history
On integrity check failure.

This makes it easier to debug failures, as normalization can make the
state update mostly useless.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
SamirTalwar authored Sep 30, 2021
1 parent be216aa commit d64d965
Showing 1 changed file with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,31 @@ object ReadServiceStateUpdateComparison {
)

if (expectedNormalizedUpdate != actualNormalizedUpdate) {
Future.failed(
new ComparisonFailureException(
"State update mismatch.",
"Expected:",
expectedNormalizedUpdate.toString,
"Actual:",
actualNormalizedUpdate.toString,
if (expectedNormalizedUpdate == expectedUpdate && actualNormalizedUpdate == actualUpdate) {
Future.failed(
new ComparisonFailureException(
"State update mismatch.",
"Expected:",
expectedNormalizedUpdate.toString,
"Actual:",
actualNormalizedUpdate.toString,
)
)
)
} else {
Future.failed(
new ComparisonFailureException(
"State update mismatch.",
"Expected (before normalization):",
expectedUpdate.toString,
"Expected (after normalization):",
expectedNormalizedUpdate.toString,
"Actual (before normalization):",
actualUpdate.toString,
"Actual (after normalization):",
actualNormalizedUpdate.toString,
)
)
}
} else {
Future.unit
}
Expand Down

0 comments on commit d64d965

Please sign in to comment.