kvutils: Print state updates before and after normalization. (#11096)

On integrity check failure.

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

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Samir Talwar 2021-09-30 13:56:30 +02:00 committed by GitHub
parent be216aa872
commit d64d965230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,15 +89,31 @@ object ReadServiceStateUpdateComparison {
) )
if (expectedNormalizedUpdate != actualNormalizedUpdate) { if (expectedNormalizedUpdate != actualNormalizedUpdate) {
Future.failed( if (expectedNormalizedUpdate == expectedUpdate && actualNormalizedUpdate == actualUpdate) {
new ComparisonFailureException( Future.failed(
"State update mismatch.", new ComparisonFailureException(
"Expected:", "State update mismatch.",
expectedNormalizedUpdate.toString, "Expected:",
"Actual:", expectedNormalizedUpdate.toString,
actualNormalizedUpdate.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 { } else {
Future.unit Future.unit
} }