It looks like after the LogWithSamplingTest suite runs, all future log output from the util_test binary gets suppressed.
Â
To demonstrate, compare the log output from running the LogWithSamplingTest suite and 1 other suite in util_test in two different orders.
TimeParsing suite first, we see logs from both suites:
> build/debug/mongo/util/util_test --suite=TimeParsing --suite=LogWithSamplingTest build/debug/mongo/util/util_test: /opt/mongodbtoolchain/v3/lib/libcurl.so.4: no version information available (required by build/debug/mongo/util/net/libhttp_client.so) {"t":\{"$date":"2020-04-10T22:11:26.831Z"},"s":"I", "c":"TEST", "id":23063, "ctx":"main","msg":"Running","attr":\{"suite":"TimeParsing"}} {"t":\{"$date":"2020-04-10T22:11:26.831Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"DateAsISO8601UTC","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.831Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"DateAsISO8601Local","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.832Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"DateAsISO8601LocalNoColon","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.832Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"InvalidDates","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.833Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"LeapYears","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.834Z"},"s":"I", "c":"TEST", "id":23060, "ctx":"main","msg":"Done running tests"} {"t":\{"$date":"2020-04-10T22:11:26.834Z"},"s":"I", "c":"TEST", "id":23063, "ctx":"main","msg":"Running","attr":\{"suite":"LogWithSamplingTest"}} {"t":\{"$date":"2020-04-10T22:11:26.834Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"ShouldLogCorrectlyWhenSampleRateIsSet","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:26.835Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"ShouldNotLogFastOp","rep":1,"reps":1}}
LogWithSamplingTest suite first, logs from TimeParsing suite disappear:
> build/debug/mongo/util/util_test --suite=LogWithSamplingTest --suite=TimeParsing build/debug/mongo/util/util_test: /opt/mongodbtoolchain/v3/lib/libcurl.so.4: no version information available (required by build/debug/mongo/util/net/libhttp_client.so) {"t":\{"$date":"2020-04-10T22:11:47.663Z"},"s":"I", "c":"TEST", "id":23063, "ctx":"main","msg":"Running","attr":\{"suite":"LogWithSamplingTest"}} {"t":\{"$date":"2020-04-10T22:11:47.664Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"ShouldLogCorrectlyWhenSampleRateIsSet","rep":1,"reps":1}} {"t":\{"$date":"2020-04-10T22:11:47.664Z"},"s":"I", "c":"TEST", "id":23059, "ctx":"main","msg":"Running","attr":\{"test":"ShouldNotLogFastOp","rep":1,"reps":1}}
This is getting in the way of our ability to debug certain build failures when tests within util_test fail.
- is caused by
-
SERVER-47418 setMinimumLoggedSeverity in unittest/log_test.h needs to get cleaned up
- Closed