From dc515c1dfbfe44074e51552491c2845aa1f9307c Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Tue, 16 Jun 2020 11:53:13 -0400 Subject: SERVER-48661 Death test cannot parse tsan output --- src/mongo/unittest/death_test.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mongo/unittest/death_test.cpp b/src/mongo/unittest/death_test.cpp index b33900aff90..50ec0fda6db 100644 --- a/src/mongo/unittest/death_test.cpp +++ b/src/mongo/unittest/death_test.cpp @@ -118,8 +118,14 @@ void DeathTestBase::_doTest() { line = line.substr(0, line.size() - 1); if (line.empty()) continue; - int parsedLen; - auto parsedChildLog = fromjson(lineBuf, &parsedLen); + int parsedLen = 0; + BSONObj parsedChildLog; + try { + parsedChildLog = fromjson(lineBuf, &parsedLen); + } catch (DBException&) { + // ignore json parsing errors and dump the whole log line as text + parsedLen = 0; + } if (static_cast(parsedLen) == line.size()) { LOGV2(20165, "child", "json"_attr = parsedChildLog); } else { -- cgit v1.2.1