Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47483

Logs from util_test unittest get suppressed

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Logging
    • None
    • Fully Compatible
    • ALL
    • Service arch 2020-04-20
    • 22

      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.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: