-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
-
Programmability 2026-07-07
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Detection of tassert failures is done at shutdown. We produce error log output, which can be awkward to read for our unittest output.
It's possible for all tests to pass in GoogleTest but the test to have a non zero exit code due to abnormal shutdown from detection of tasserts. In these cases, we won't have any information about where the tassert failed. This is especially bad with the enhanced reporter:
Running 92 tests in 10 suites [ 0 of 1 ]
92 TOTAL / 92 PASS / 0 FAIL / 0 SKIP [ 0 of 1 ]
{"t":{"$date":"2026-07-16T19:40:43.100+00:00"},"s":"I", "c":"ASSERT", "id":4457002, "ctx":"main","msg":"Detected prior failed tripwire assertions, please check your logs for \"Tripwire assertion\" entries with log id 4457000.","attr":{"occurrences":1}}
{"t":{"$date":"2026-07-16T19:40:43.100+00:00"},"s":"F", "c":"-", "id":4457001, "ctx":"main","msg":"Aborting process during exit due to prior failed tripwire assertions."}
{"t":{"$date":"2026-07-16T19:40:43.100+00:00"},"s":"F", "c":"ASSERT", "id":23091, "ctx":"main","msg":"Fatal assertion","attr":{"msgid":4457001,"location":"src/mongo/util/testing_proctor.cpp:68:93:void mongo::TestingProctor::exitAbruptlyIfDeferredErrors(bool) const"}}
{"t":{"$date":"2026-07-16T19:40:43.100+00:00"},"s":"F", "c":"ASSERT", "id":23092, "ctx":"main","msg":"\n\n***aborting after fassert() failure\n\n"}
{"t":{"$date":"2026-07-16T19:40:43.100+00:00"},"s":"I", "c":"ASSERT", "id":4457002, "ctx":"main","msg":"Detected prior failed tripwire assertions, please check your logs for \"Tripwire assertion\" entries with log id 4457000.","attr":{"occurrences":1}}
We should do 2 things:
- We should make these tassert failures more seamless with the googletest output.
- We should record source location info (test only) for failed tasserts.
Before:
[2026/07/16 10:30:04.726] [----------] 15 tests from BSONArrayIndexesInvalid/BSONValidateArrayIndexing (0 ms total)
[2026/07/16 10:30:04.726] [----------] Global test environment tear-down
[2026/07/16 10:30:04.726] [==========] 271 tests from 26 test suites ran. (290 ms total)
[2026/07/16 10:30:04.726] [ PASSED ] 271 tests.
[2026/07/16 10:30:04.726] {"t":{"$date":"2026-07-16T14:25:07.623+00:00"},"s":"I", "c":"ASSERT", "id":4457002, "ctx":"main","msg":"Detected prior failed tripwire assertions, please check your logs for \"Tripwire assertion\" entries with log id 4457000.","attr":{"occurrences":1}}
[2026/07/16 10:30:04.726] {"t":{"$date":"2026-07-16T14:25:07.623+00:00"},"s":"F", "c":"-", "id":4457001, "ctx":"main","msg":"Aborting process during exit due to prior failed tripwire assertions."}
[2026/07/16 10:30:04.726] {"t":{"$date":"2026-07-16T14:25:07.623+00:00"},"s":"F", "c":"ASSERT", "id":23091, "ctx":"main","msg":"Fatal assertion","attr":{"msgid":4457001,"location":"src/mongo/util/testing_proctor.cpp:68:93:void mongo::TestingProctor::exitAbruptlyIfDeferredErrors(bool) const"}}
[2026/07/16 10:30:04.726] {"t":{"$date":"2026-07-16T14:25:07.623+00:00"},"s":"F", "c":"ASSERT", "id":23092, "ctx":"main","msg":"\n\n***aborting after fassert() failure\n\n"}
[2026/07/16 10:30:04.726] {"t":{"$date":"2026-07-16T14:25:07.623+00:00"},"s":"I", "c":"ASSERT", "id":4457002, "ctx":"main","msg":"Detected prior failed tripwire assertions, please check your logs for \"Tripwire assertion\" entries with log id 4457000.","attr":{"occurrences":1}}
After (example):
[2026/07/16 10:30:04.726] [----------] 15 tests from BSONArrayIndexesInvalid/BSONValidateArrayIndexing (0 ms total) [2026/07/16 10:30:04.726] [----------] Global test environment tear-down [2026/07/16 10:30:04.726] [==========] 271 tests from 26 test suites ran. (290 ms total) [2026/07/16 10:30:04.726] [ PASSED ] 271 tests. [2026/07/16 10:30:04.726] [ FAIL ] Detected 1 failed tassert(s) in BSONArrayIndexesInvalid/BSONValidateArrayIndexing