From b0d8ccbbcaf14cb68dd11cfa7a7586732d180df9 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Wed, 28 Sep 2022 15:17:12 -0700 Subject: [PATCH] db_stress print TestMultiGet error value in hex (#10753) Summary: Without this fix, db_crashtest.py could fail with useless output such as: `UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 267: invalid start byte` Pull Request resolved: https://github.com/facebook/rocksdb/pull/10753 Reviewed By: hx235 Differential Revision: D39905809 Pulled By: ajkr fbshipit-source-id: 50ba2cf20d206eeb168309cec137e827a34c8f0b --- db_stress_tool/no_batched_ops_stress.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_stress_tool/no_batched_ops_stress.cc b/db_stress_tool/no_batched_ops_stress.cc index 241fb322b..86a1b4a7d 100644 --- a/db_stress_tool/no_batched_ops_stress.cc +++ b/db_stress_tool/no_batched_ops_stress.cc @@ -614,7 +614,8 @@ class NonBatchedOpsStressTest : public StressTest { keys[i].ToString(true).c_str()); fprintf(stderr, "MultiGet returned value %s\n", values[i].ToString(true).c_str()); - fprintf(stderr, "Get returned value %s\n", value.c_str()); + fprintf(stderr, "Get returned value %s\n", + Slice(value).ToString(true /* hex */).c_str()); is_consistent = false; } }