diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2020-06-16 11:53:13 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-16 17:14:40 +0000 |
commit | dc515c1dfbfe44074e51552491c2845aa1f9307c (patch) | |
tree | 537de496a757738d1e676c08c334367bd296b607 | |
parent | 336636a95cf29ef9b2641a4dc768b585e845bd6b (diff) | |
download | mongo-dc515c1dfbfe44074e51552491c2845aa1f9307c.tar.gz |
SERVER-48661 Death test cannot parse tsan output
-rw-r--r-- | src/mongo/unittest/death_test.cpp | 10 |
1 files 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<size_t>(parsedLen) == line.size()) { LOGV2(20165, "child", "json"_attr = parsedChildLog); } else { |