Skip to content

Commit e7b879f

Browse files
authored
Make failures in keyvalue/ut_trace more verbose (#26432)
1 parent a35c9c1 commit e7b879f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ydb/core/keyvalue/keyvalue_ut_trace.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void TestOneWrite(TString value, TVector<TString> &&expectedTraceVariants) {
111111
}
112112
);
113113

114-
UNIT_ASSERT(oneIsGood);
114+
UNIT_ASSERT_C(oneIsGood, env.WilsonUploader->PrintTraces());
115115
}
116116

117117
void TestOneRead(TString value, TString expectedTrace) {
@@ -134,7 +134,8 @@ void TestOneRead(TString value, TString expectedTrace) {
134134
return trace.ToString() == expectedTrace;
135135
}
136136
);
137-
UNIT_ASSERT(oneIsGood);
137+
138+
UNIT_ASSERT_C(oneIsGood, env.WilsonUploader->PrintTraces());
138139
}
139140

140141
Y_UNIT_TEST_SUITE(TKeyValueTracingTest) {

ydb/library/actors/wilson/test_util/fake_wilson_uploader.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ namespace NWilson {
162162

163163
public:
164164
std::unordered_map<TString, Trace> Traces;
165+
166+
TString PrintTraces() const {
167+
TStringStream str;
168+
for (const auto& [_, trace] : Traces) {
169+
str << "{ " << trace.ToString() << " } ";
170+
}
171+
return str.Str();
172+
}
165173
};
166174

167175
} // NWilson

0 commit comments

Comments
 (0)